Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] file_url has spaces in the URL, Kodi can't play it #380

Closed
3 tasks done
ambulancePilot opened this issue Jul 15, 2024 · 85 comments
Closed
3 tasks done

[BUG] file_url has spaces in the URL, Kodi can't play it #380

ambulancePilot opened this issue Jul 15, 2024 · 85 comments
Assignees
Labels
bug Something isn't working

Comments

@ambulancePilot
Copy link

ambulancePilot commented Jul 15, 2024

Bug

When the rd_link is passed to the file_url, it carries any spaces that were present in the URL along with it. For example:

2024-07-15 17:32:42.189 T:8288 error <general>: CFileCache::Open - <https://nyk2-4.download.real-debrid.com/d/XXXXXXXXX/The Kardashians S05E08 This Is My Most Important Job 1080p DSNP WEB-DL DDP5 1 H 264-FLUX[EZTVx.to].mkv> failed to open

Expected Result

The URL should be encoded just prior to being passed to the player such that the URL is in acceptable format and can be played.

Steps To Reproduce

Try to play the above mentioned Kardashians episode (the same torrent).

Kodi Version, Type of Device, Logs, Screenshots, and Additional Info

In order to fix this, I changed line 472 in realdebrid.py to the following:

file_url = quote_plus(self.unrestrict_link(rd_link))

After this, the issue is eliminated. I am not sure if this is the correct way to fix it, so I would appreciate if you could please look into it and address the issue of the URL being passed to the Kodi player with spaces.

Thanks so much for your work in the community.

Checklist

  • I have included logs and the version of Kodi I am using..
  • I have made a separate issue for each bug that I am reporting.
  • I have verified this is not a setting.
@ambulancePilot ambulancePilot added the bug Something isn't working label Jul 15, 2024
@umbrellaplug
Copy link
Owner

Good catch. I'll include this in the next update. You'd think rd would be passing those back url encoded, but I guess not. Could also blame stupid file name use but no reason to point fingers when there's an easy enough fix. Next update will have this.

@ambulancePilot
Copy link
Author

ambulancePilot commented Jul 16, 2024 via email

@umbrellaplug
Copy link
Owner

I figured if it meant enough to you to admit you were watching Kardashians then I could at least fix it.
😆

@ambulancePilot
Copy link
Author

ambulancePilot commented Jul 16, 2024 via email

@ambulancePilot
Copy link
Author

ambulancePilot commented Jul 16, 2024 via email

@ambulancePilot
Copy link
Author

ambulancePilot commented Jul 16, 2024 via email

@ambulancePilot
Copy link
Author

ambulancePilot commented Jul 16, 2024 via email

@ambulancePilot
Copy link
Author

ambulancePilot commented Jul 16, 2024

EDIT: I jumped the gun on this, looks like we need to replace square brackets as well. I'm now on a mission to figure out what characters are unacceptable to the player. I'll update this code once I have a comprehensive list of replacements.

I have a feeling once I create the dictionary for replacements and get that Kardashians episode working again, it's going to break something else! But let's see...

Please try this:

file_url = self.unrestrict_link(rd_link)
file_url = file_url.replace(" ", "+")

No need to use quote_plus and fuck up the entire URL. It does more to the URL than I thought. It's surprising TV shows even played.

We just need to replace spaces with the plus sign so the Kodi player can interpret the URL. Movies work with this as well as TV shows.

Can you check and see if it breaks anything else? Theoretically it should not as we are only making the requisite change and nothing else.

Thank you for your time! I hope this is the one.

@umbrellaplug
Copy link
Owner

This is causing other issues with special characters. Can you give me an example of exact file you're dealing with so I can test here?

@umbrellaplug
Copy link
Owner

"Mars Attacks!" "¡Three Amigos!" just to give a couple examples. I really need to see the actual file and try it myself. I may be able to use a regular expression to adjust it but it'll take a few tries so I could use an example file to work with.

@umbrellaplug
Copy link
Owner

Also.... I'd be failing myself if I didn't mention. Didn't I read a comment from you on reddit a while back when I was upset about the asshole making a clone of umbrella and being a dick to me that you couldn't wait for chatgpt to be capable to replace people like me so you didn't have to worry about your addons being controlled by crybabies?

If that's the case and something has changed and now you're using Umbrella, that's some wild stuff to say about someone to be on here asking for changes and such like that never happened. I'm not going to be a jerk or lecture here and I'm going to look at your issue you're reporting still, but maybe in the future remember you're talking about a person before you make a statement like that. Try not to light your way forward with the bridges you've burned.

Maybe I'm wrong and that's someone else and in that case I'm sorry, but I don't think I am.

Repository owner deleted a comment from umbrellakodi Jul 17, 2024
Repository owner deleted a comment from umbrellakodi Jul 17, 2024
Repository owner deleted a comment from umbrellakodi Jul 17, 2024
@umbrellaplug
Copy link
Owner

I just checked this exact file and it works from windows and android. I'm not sure this is an actual issue. Can you provide another example file? Seems like this may have been part of the real debrid issues the past few days.

@ambulancePilot
Copy link
Author

Sorry for the late reply, busy with work and whatnot.

Yes, I'm am that dude. I have been clear with what my issues are with the other developer. Now that the red hat is out of the bag, I'm done.

You are professional and take pride in your work. He does not. No one who takes pride in their work makes their product worse out of a personal grudge.

In the end, he's free to do what he wants and I'm free to bitch and complain about it.

To be clear, this is a dude who votes for a guy who wants to destroy the lives of LGBTQ people including myself, amongst other minority groups. Just because he doesn't spew vitriol on reddit doesn't mean he isn't a POS. I haven't met a single Trump supporter in my entire life who had any answer for the people who's lives he plans to diminish. Collateral damage, I guess, right? Fuck those people.

Moving on.

Further inspection shows there is no issue playing torrents that contain video files with spaces in them as long as they are a movie torrent. I confirmed this by playing this torrent through a filterless scrape: https://bitsearch.to/torrents/spider-man-no-way-home-2022-1080p-dual-lat-cinecal-83112/6231dcba427e2e63a76a82d6/

The issue is isolated to episodes. Thus:

if season:
return quote_plus(file_url)
else:
return file_url

I have tested this as much as I can and can't seem to come up with any errors, but I am sure you are more effective at that than I. I hope we can continue to work together, at least on this issue.

Thanks for your time, as always.

@umbrellaplug
Copy link
Owner

Cool, as I said. not here to lecture or bitch. I can respect at least owning up to previous comments. I'm not always proud of statements I've made either, but I can only try to grow from it.

The red hat shit... ehhh I'll leave that shit alone.

I'm wondering if this is a device thing. linux vs windows vs android. What type of device are you having this issue on? Can you give me exact steps to duplicate because I tried the Kardashians Season 5 Episode 8 and it appeared to match the one you tried to play from rd, but it played for me with no issues without any code changes. I'm not giving you a hard time here. I want to fix the issue, I just need to understand where it's coming into play so I can address it correctly. I'm unable to duplicate on a shield or on my windows lab machine.

@ambulancePilot
Copy link
Author

ambulancePilot commented Jul 17, 2024 via email

@AdeHub
Copy link

AdeHub commented Jul 20, 2024

Hi

I possibly have the same issue on Apple TV

2024-07-20 20:57:34.836 T:263652    info <general>: VideoPlayer::OpenFile: plugin://plugin.video.umbrella/?action=rescrapeMenu&title=Episode+3&year=2024&imdb=tt13649112&tmdb=241259&tvdb=417223&season=1&episode=3&tvshowtitle=Baby+Reindeer&premiered=2024-04-11&meta=%7B%22premiered%22%3A+%222024-04-11%22%2C+%22season_isAiring%22%3A+%22false%22%2C+%22seasoncount%22%3A+7%2C+%22plot%22%3A+%22Donny+takes+some+time+off+from+the+pub+and+tries+to+make+amends+with+Teri.+But+no+matter+how+much+he+avoids+Martha%2C+he+can%27t+escape+her+for+long.%22%2C+%22tmdb%22%3A+%22241259%22%2C+%22poster%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2Fe5MUdXRjl90Up5dAEdvsGs4zAAS.jpg%22%2C+%22season%22%3A+1%2C+%22castandart%22%3A+%5B%7B%22name%22%3A+%22Richard+Gadd%22%2C+%22role%22%3A+%22Donny+Dunn%22%2C+%22thumbnail%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2Ft5x4PjeJg9ELGToI0kGsTLcBkdf.jpg%22%7D%2C+%7B%22name%22%3A+%22Jessica+Gunning%22%2C+%22role%22%3A+%22Martha+Scott%22%2C+%22thumbnail%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2Fc4nC6usiZdRlw4VkOcHFLXtrPa0.jpg%22%7D%2C+%7B%22name%22%3A+%22Nava+Mau%22%2C+%22role%22%3A+%22Teri%22%2C+%22thumbnail%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2Fu8cS0PxTVnNJQeWItZdcr6JxrBs.jpg%22%7D%5D%2C+%22mediatype%22%3A+%22episode%22%2C+%22episode%22%3A+3%2C+%22director%22%3A+%22Weronika+Tofilska%22%2C+%22writer%22%3A+%22Richard+Gadd%22%2C+%22tmdb_epID%22%3A+5227315%2C+%22title%22%3A+%22Episode+3%22%2C+%22duration%22%3A+2340%2C+%22episode_type%22%3A+%22standard%22%2C+%22thumb%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2F39YGnnlZisihAO5yJzo31StWWLm.jpg%22%2C+%22rating%22%3A+7.765%2C+%22votes%22%3A+17%2C+%22tvshowtitle%22%3A+%22Baby+Reindeer%22%2C+%22year%22%3A+%222024%22%2C+%22imdb%22%3A+%22tt13649112%22%2C+%22tvdb%22%3A+%22417223%22%2C+%22aliases%22%3A+%5B%5D%2C+%22country_codes%22%3A+%5B%22GB%22%5D%2C+%22total_seasons%22%3A+1%2C+%22counts%22%3A+%7B%221%22%3A+7%7D%2C+%22studio%22%3A+%22Netflix%22%2C+%22genre%22%3A+%22Drama%22%2C+%22mpaa%22%3A+%2218%22%2C+%22status%22%3A+%22Ended%22%2C+%22fanart%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2FtTGhI7lqd4frPS6XzR0d5gcXTMc.jpg%22%2C+%22icon%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2Fe5MUdXRjl90Up5dAEdvsGs4zAAS.jpg%22%2C+%22banner%22%3A+%22https%3A%2F%2Fassets.fanart.tv%2Ffanart%2Ftv%2F417223%2Ftvbanner%2Fbaby-reindeer-664ded6c604a3.jpg%22%2C+%22clearlogo%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2FtimZdihwYx5hHJFJFBTWuViPmlT.png%22%2C+%22landscape%22%3A+%22https%3A%2F%2Fassets.fanart.tv%2Ffanart%2Ftv%2F417223%2Ftvthumb%2Fbaby-reindeer-6634f95e9ceaa.jpg%22%2C+%22extended%22%3A+true%2C+%22label%22%3A+%22Episode+3%22%2C+%22code%22%3A+%22tt13649112%22%2C+%22imdbnumber%22%3A+%22tt13649112%22%2C+%22tag%22%3A+%5B%22tt13649112%22%2C+%22241259%22%5D%7D
2024-07-20 20:57:34.836 T:266543    info <general>: Creating InputStream
2024-07-20 20:57:34.836 T:266543   error <general>: CCurlFile::CReadState::FillBuffer - (0x11b24d4e0) Failed: URL using bad/illegal format or missing URL(3)
2024-07-20 20:57:34.836 T:266543   error <general>: CCurlFile::Open - <https://syd3.download.real-debrid.com/d/JLSHYWDJWPJFQ83/Baby Reindeer S01E03 Episode 3 1080p NF WEB-DL DDP5 1 Atmos H 264-FLUX[EZTVx.to].mkv> Failed with code 0:
                                                   
2024-07-20 20:57:34.837 T:266543   error <general>: CCurlFile::CReadState::FillBuffer - (0x11b24d4e0) Failed: URL using bad/illegal format or missing URL(3)
2024-07-20 20:57:34.837 T:266543   error <general>: CCurlFile::Open - <https://syd3.download.real-debrid.com/d/JLSHYWDJWPJFQ83/Baby Reindeer S01E03 Episode 3 1080p NF WEB-DL DDP5 1 Atmos H 264-FLUX[EZTVx.to].mkv> Failed with code 0:
                                                   
2024-07-20 20:57:34.837 T:266543   error <general>: CFileCache::Open - <https://syd3.download.real-debrid.com/d/JLSHYWDJWPJFQ83/Baby Reindeer S01E03 Episode 3 1080p NF WEB-DL DDP5 1 Atmos H 264-FLUX[EZTVx.to].mkv> failed to open
2024-07-20 20:57:34.837 T:266543   error <general>: CVideoPlayer::OpenInputStream - error opening [plugin://plugin.video.umbrella/?action=rescrapeMenu&title=Episode+3&year=2024&imdb=tt13649112&tmdb=241259&tvdb=417223&season=1&episode=3&tvshowtitle=Baby+Reindeer&premiered=2024-04-11&meta=%7B%22premiered%22%3A+%222024-04-11%22%2C+%22season_isAiring%22%3A+%22false%22%2C+%22seasoncount%22%3A+7%2C+%22plot%22%3A+%22Donny+takes+some+time+off+from+the+pub+and+tries+to+make+amends+with+Teri.+But+no+matter+how+much+he+avoids+Martha%2C+he+can%27t+escape+her+for+long.%22%2C+%22tmdb%22%3A+%22241259%22%2C+%22poster%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2Fe5MUdXRjl90Up5dAEdvsGs4zAAS.jpg%22%2C+%22season%22%3A+1%2C+%22castandart%22%3A+%5B%7B%22name%22%3A+%22Richard+Gadd%22%2C+%22role%22%3A+%22Donny+Dunn%22%2C+%22thumbnail%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2Ft5x4PjeJg9ELGToI0kGsTLcBkdf.jpg%22%7D%2C+%7B%22name%22%3A+%22Jessica+Gunning%22%2C+%22role%22%3A+%22Martha+Scott%22%2C+%22thumbnail%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2Fc4nC6usiZdRlw4VkOcHFLXtrPa0.jpg%22%7D%2C+%7B%22name%22%3A+%22Nava+Mau%22%2C+%22role%22%3A+%22Teri%22%2C+%22thumbnail%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2Fu8cS0PxTVnNJQeWItZdcr6JxrBs.jpg%22%7D%5D%2C+%22mediatype%22%3A+%22episode%22%2C+%22episode%22%3A+3%2C+%22director%22%3A+%22Weronika+Tofilska%22%2C+%22writer%22%3A+%22Richard+Gadd%22%2C+%22tmdb_epID%22%3A+5227315%2C+%22title%22%3A+%22Episode+3%22%2C+%22duration%22%3A+2340%2C+%22episode_type%22%3A+%22standard%22%2C+%22thumb%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2F39YGnnlZisihAO5yJzo31StWWLm.jpg%22%2C+%22rating%22%3A+7.765%2C+%22votes%22%3A+17%2C+%22tvshowtitle%22%3A+%22Baby+Reindeer%22%2C+%22year%22%3A+%222024%22%2C+%22imdb%22%3A+%22tt13649112%22%2C+%22tvdb%22%3A+%22417223%22%2C+%22aliases%22%3A+%5B%5D%2C+%22country_codes%22%3A+%5B%22GB%22%5D%2C+%22total_seasons%22%3A+1%2C+%22counts%22%3A+%7B%221%22%3A+7%7D%2C+%22studio%22%3A+%22Netflix%22%2C+%22genre%22%3A+%22Drama%22%2C+%22mpaa%22%3A+%2218%22%2C+%22status%22%3A+%22Ended%22%2C+%22fanart%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2FtTGhI7lqd4frPS6XzR0d5gcXTMc.jpg%22%2C+%22icon%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2Fe5MUdXRjl90Up5dAEdvsGs4zAAS.jpg%22%2C+%22banner%22%3A+%22https%3A%2F%2Fassets.fanart.tv%2Ffanart%2Ftv%2F417223%2Ftvbanner%2Fbaby-reindeer-664ded6c604a3.jpg%22%2C+%22clearlogo%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Foriginal%2FtimZdihwYx5hHJFJFBTWuViPmlT.png%22%2C+%22landscape%22%3A+%22https%3A%2F%2Fassets.fanart.tv%2Ffanart%2Ftv%2F417223%2Ftvthumb%2Fbaby-reindeer-6634f95e9ceaa.jpg%22%2C+%22extended%22%3A+true%2C+%22label%22%3A+%22Episode+3%22%2C+%22code%22%3A+%22tt13649112%22%2C+%22imdbnumber%22%3A+%22tt13649112%22%2C+%22tag%22%3A+%5B%22tt13649112%22%2C+%22241259%22%5D%7D]

Edit: also doesn't play on my MacBook

@saxoloman
Copy link

Same with coreelec

@ambulancePilot
Copy link
Author

Hey there sorry about the delay in getting back. Had a busy weekend.

I return with some news. On Windows, the torrent I am talking about plays without issue even though it has spaces in it. The spaces don't affect playback.

2024-07-21 20:00:14.638 T:19032 info <general>: VideoPlayer::OpenFile: https://nyk1-4.download.real-debrid.com/d/xxxxxxxx/The Kardashians S05E08 This Is My Most Important Job 1080p DSNP WEB-DL DDP5 1 H 264-FLUX[EZTVx.to].mkv
2024-07-21 20:00:15.080 T:4424 info <general>: Creating InputStream
2024-07-21 20:00:16.065 T:4424 info <general>: Creating Demuxer
2024-07-21 20:00:18.431 T:4424 info <general>: Opening stream: 0 source: 256

So spaces in the file_url don't impede playback on Windows and Shield TV. But playback fials on MacBook, CoreElec, and Fire Stick. Definitely device dependent.

The reason I went with the code above (if season etc) is because I noticed in the log that the debrid link isn't passed to the player, but an umbrella:// link is passed (in the case of movies only). Maybe I'm wrong but is that the reason spaces in the file_url don't affect movies?

So that's why I thought adding quotes_plus to just the file_url for episodes would be a good option.

Have you any thoughts?

@umbrellaplug umbrellaplug reopened this Jul 22, 2024
@umbrellaplug
Copy link
Owner

I have a MacBook. I should be able to come up with a solution now that I have a way to duplicate the issue. Let me look at what's happening and what you've attempted and I'll get back with you.

@umbrellaplug
Copy link
Owner

Unable to duplicate this so far. I tried with a MacBook running BigSur. I'm wondering if I will see this issue on an intel chipset. I doubt it. I have a dual boot on this device so I will try with a newer version of Mac (Sonoma) and see if that makes a difference. Otherwise I'll have to start looking at what other devices I have around here to try to duplicate this.

@umbrellaplug
Copy link
Owner

Thus far this works on big sur, sonoma, pibox, sheild, windows, xbox series x.

Let me try to load my apple tv device up. I don't have a firestick 4k or any of that coreelec shit.

@umbrellaplug
Copy link
Owner

Apple TV no issue either. Am I trying the wrong files here?
2024-07-22 11:21:30.023 T:19178 info : VideoPlayer::OpenFile: plugin://plugin.video.umbrella/?action=play_Item&title=This+Is+My+Most+Important+Job&year=2022&imdb=tt15791630&tmdb=154521&tvdb=414093&season=5&episode=8&tvshowtitle=The+Kardashians&premiered=2024-07-11&meta=%7B%22premiered%22%3A+%222024-07-11%22%2C+%22season_isAiring%22%3A+%22true%22%2C+%22seasoncount%22%3A+10%2C+%22plot%22%3A+%22Kim+and+Kourtney+face+new+chapters+of+motherhood%2C+while+Kris+struggles+to+process+her+upcoming+surgery.+The+whole+family+gets+together+for+a+photoshoot+before+Kim+heads+to+New+Orleans+to+meet+with+Gypsy+Rose+Blanchard.%22%2C+%22tmdb%22%3A+%22154521%22%2C+%22poster%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw342%2Fy5tqHu7Rly3RS9uJZqTTraf7mQ2.jpg%22%2C+%22season_poster%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw342%2Fy5tqHu7Rly3RS9uJZqTTraf7mQ2.jpg%22%2C+%22season%22%3A+5%2C+%22castandart%22%3A+%5B%7B%22name%22%3A+%22Kris+Jenner%22%2C+%22role%22%3A+%22Self%22%2C+%22thumbnail%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw342%2F2XHSec5q7NxXh5WCSTeVdGTT6mI.jpg%22%7D%2C+%7B%22name%22%3A+%22Kourtney+Kardashian+Barker%22%2C+%22role%22%3A+%22Self%22%2C+%22thumbnail%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw342%2FdE3CztdZ1leY94HP2CIEQaXnexg.jpg%22%7D%2C+%7B%22name%22%3A+%22Kim+Kardashian%22%2C+%22role%22%3A+%22Self%22%2C+%22thumbnail%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw342%2FcTuLiimHK338z9qCTurMIqFoQ25.jpg%22%7D%2C+%7B%22name%22%3A+%22Khlo%5Cu00e9+Kardashian%22%2C+%22role%22%3A+%22Self%22%2C+%22thumbnail%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw342%2F9KozpelrLI11rGVnP81ZHqAxGsx.jpg%22%7D%2C+%7B%22name%22%3A+%22Kendall+Jenner%22%2C+%22role%22%3A+%22Self%22%2C+%22thumbnail%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw342%2FccREiRWn47w1yYLKNzosFYq8ok.jpg%22%7D%2C+%7B%22name%22%3A+%22Kylie+Jenner%22%2C+%22role%22%3A+%22Self%22%2C+%22thumbnail%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw342%2FhQx8UnvYSSJfsDqvwgvvZpnDSzu.jpg%22%7D%5D%2C+%22mediatype%22%3A+%22episode%22%2C+%22episode%22%3A+8%2C+%22tmdb_epID%22%3A+5366448%2C+%22title%22%3A+%22This+Is+My+Most+Important+Job%22%2C+%22duration%22%3A+2820%2C+%22episode_type%22%3A+%22standard%22%2C+%22thumb%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw500%2Fr5mAAdlPyjm8vZy2MYNG754Bk1o.jpg%22%2C+%22rating%22%3A+10.0%2C+%22votes%22%3A+1%2C+%22tvshowtitle%22%3A+%22The+Kardashians%22%2C+%22year%22%3A+%222022%22%2C+%22imdb%22%3A+%22tt15791630%22%2C+%22tvdb%22%3A+%22414093%22%2C+%22aliases%22%3A+%5B%5D%2C+%22country_codes%22%3A+%5B%22US%22%5D%2C+%22total_seasons%22%3A+5%2C+%22counts%22%3A+%7B%221%22%3A+10%2C+%222%22%3A+10%2C+%223%22%3A+10%2C+%224%22%3A+10%2C+%225%22%3A+10%7D%2C+%22studio%22%3A+%22Hulu%22%2C+%22genre%22%3A+%22Reality%22%2C+%22mpaa%22%3A+%22TV-14%22%2C+%22status%22%3A+%22Returning+Series%22%2C+%22fanart%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw780%2FqRHu9tSD2CKf10IlFr5FztO4Rxh.jpg%22%2C+%22icon%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw342%2Fy5tqHu7Rly3RS9uJZqTTraf7mQ2.jpg%22%2C+%22banner%22%3A+%22https%3A%2F%2Fassets.fanart.tv%2Ffanart%2Ftv%2F414093%2Ftvbanner%2Fthe-kardashians-6290969fe950a.jpg%22%2C+%22clearlogo%22%3A+%22https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw780%2Fyd17TqEcvP9FcbtRNtZpcLCOhFj.png%22%2C+%22extended%22%3A+true%2C+%22next_episode_to_air%22%3A+%7B%22air_date%22%3A+%222022-02-10%22%2C+%22episode_number%22%3A+7%7D%2C+%22label%22%3A+%22This+Is+My+Most+Important+Job%22%2C+%22code%22%3A+%22tt15791630%22%2C+%22imdbnumber%22%3A+%22tt15791630%22%2C+%22tag%22%3A+%5B%22tt15791630%22%2C+%22154521%22%5D%7D
2024-07-22 11:21:30.428 T:20938 info : Creating InputStream
2024-07-22 11:21:31.254 T:20938 info : Creating Demuxer
2024-07-22 11:21:32.415 T:20938 info : Opening stream: 0 source: 256
2024-07-22 11:21:32.416 T:20938 info : Creating video codec with codec id: 27

@umbrellaplug
Copy link
Owner

umbrellaplug commented Jul 22, 2024

Alright no offense fellas but I'm not going to waste any more time on this trying to find a device that DOESN'T work right. Everything I've tried this on works without any issues. If someone wants to actually turn logging on and provide some actual logs then feel free but I will not be doing anymore troubleshooting here based on snippets of logs or speculation. Closing this issue.

@saxoloman
Copy link

Works on coreelec.
Thank you.
I didnt test autoplay yet

@ambulancePilot
Copy link
Author

Will check autoplay when I get home. :(

@umbrellaplug
Copy link
Owner

This is why I get paid the big $$$. I'll see what's happening with autoplay. There's an issue here for sure.

@AdeHub
Copy link

AdeHub commented Jul 26, 2024

yeah, getting an error with autoplay

@umbrellaplug
Copy link
Owner

I believe I have this fixed. I will be pushing a new version out. kodifitzwell was on the right track.

@umbrellaplug
Copy link
Owner

umbrellaplug commented Jul 26, 2024

I just pushed 6.6.627 to the test repo. I'm sorry to keep asking but can you all try this version? It should work on both autoplay and source select now. I think this is going to be the fix you've all been looking for.

@ambulancePilot Since you seem to be interested. The difference did come down to quote_plus vs requote_uri. With autoplay the url was being passed encoded already. With source select it was not. When running the encoded url through quote_plus it would try to encode it again causing it to break the link. This is why autoplay broke with this change. With requote_uri it actually makes no changes if the url is already encoded. I'll include some examples...

autoplay being passed in:
https://ichangedthis.realdebrid.com/d/OA7IGJ5KPE34G72/Baby%20Reindeer%20S01E03%20Episode%203%201080p%20NF%20WEB-DL%20DDP5%201%20Atmos%20H%20264-FLUX%5BEZTVx.to%5D.mkv

after quoteplus this would be changed to:
https%3A%2F%2F/ichangedthis.realdebrid.com%2Fd%2FOA7IGJ5KPE34G72%2FBaby%2520Reindeer%2520S01E03%2520Episode%25203%25201080p%2520NF%2520WEB-DL%2520DDP5%25201%2520Atmos%2520H%2520264-FLUX%255BEZTVx.to%255D.mkv

after requote_uri it would be changed to:
https://ichangedthis.realdebrid.com/d/OA7IGJ5KPE34G72/Baby%20Reindeer%20S01E03%20Episode%203%201080p%20NF%20WEB-DL%20DDP5%201%20Atmos%20H%20264-FLUX%5BEZTVx.to%5D.mkv

In control.py I made a new function called uriEncode. I made it in control instead of the player.py file so if I find a need to use it in the future for other urls within the plugin I can call it from the control module anywhere I've imported control by running url = control.uriEncode(url)
This is the change I made on line 80 of player.py.

url = control.uriEncode(url)

Hopefully this makes sense. I feel like I'm ranting.

@umbrellaplug umbrellaplug reopened this Jul 26, 2024
@AdeHub
Copy link

AdeHub commented Jul 26, 2024

Not working with source select

https://paste.kodi.tv/agibegafol
https://paste.kodi.tv/eyoloyayuf

@ambulancePilot
Copy link
Author

Unfortunately not working with autoplay either.

https://paste.kodi.tv/isugihiked.kodi

@ambulancePilot
Copy link
Author

ambulancePilot commented Jul 26, 2024

I changed back to quote_plus with exceptions in uriEncode and it works with source select and autoplay!

from urllib.parse import unquote, unquote_plus, quote_plus
...
def uriEncode(url):
    url = url
    try:
        url = quote_plus(url, safe='/:~_-.*')
        return url
    except:
        return url

@ambulancePilot
Copy link
Author

Will get you a log in one sec.

@ambulancePilot
Copy link
Author

Log showing successful playback with the above code change to your new function. I tried autoplay episode, source select episode, source select movie, as well as source select for an episode known to work before these changes (i.e. an episode with no spaces in the file name).

https://paste.kodi.tv/uzunoxaneb.kodi

@ambulancePilot
Copy link
Author

ambulancePilot commented Jul 26, 2024

https://www.online-python.com/03nuMyZ7lE

It's because fire stick and the other devices need spaces converted to %20 instead of + symbols.
requote_uri turns them to plus signs and quote_plus changes them to %20. Need to use the safe exceptions because otherwise it will convert the slashes in the url to %2F which the kodi player doesn't like either.

I tested that independently with the Kodi player and it can't play those files. On Windows it plays no problem with plus signs and spaces. lol

Your logic to create a new function for this to manage future instances of the same issue makes sense!

@umbrellaplug
Copy link
Owner

The difference is the safe parameter being sent. I'm pushing another update without the requote_uri as it's not needed. You are correct that the linux based devices are the ones having trouble with this because of the + vs %20. With the safe parameter added into the quote plus it should keep from jacking up the url on autoplay items by trying to re-encode an already encoded value. The control.py function will be removed completely and player.py changed to quote_plus with safe parameters. Hopefully this will work for everyone and this issue can be closed out for good.

@umbrellaplug
Copy link
Owner

@ambulancePilot You might want to let your friend kodifitzwell know the differences here as it may be affecting his "offcloud" integration on linux based devices. It won't be well received from me so I'll avoid that one.

@ambulancePilot
Copy link
Author

I just wish everyone could get along for the sole purpose of making these addons better. I will share what we've learned here with him and hopefully he can use it to address any issues his users are facing.

@umbrellaplug
Copy link
Owner

I just wish everyone could get along for the sole purpose of making these addons better. I will share what we've learned here with him and hopefully he can use it to address any issues his users are facing.

This statement goes both ways. I've been off reddit for months because of the toxic environment from all sides. At this point I only see posts from links people send me saying "hey, have you seen this?". If I didn't love kodi and doing the code I would have "quit" this a long time ago. Dealing with the public for free is bullshit.

@umbrellaplug
Copy link
Owner

@AdeHub @saxoloman Can you guys please test 6.6.628 with auto-play and source select on your many janky devices?

@saxoloman
Copy link

Works fine with both source select and autoplay on coreelec.

@AdeHub
Copy link

AdeHub commented Jul 27, 2024

Working on macOS

And Apple TV

@umbrellaplug
Copy link
Owner

@AdeHub @saxoloman Can you guys please test 6.6.629 with auto-play and source select? I apologize, but I believe the actual issue has been tracked down and resolved now and I want to verify this version is working for the different devices before pushing it to the release side.

@ambulancePilot
Copy link
Author

ambulancePilot commented Jul 27, 2024

Autoplay and source select both working for episodes and movies. This is on fire stick. Great work! If willing, please explain your fix?

@saxoloman
Copy link

It failed to play with 6.6.629 on autoplay few times.
I enabled debuging and now i cant reproduce it anymore :(

@ambulancePilot
Copy link
Author

I haven't had a single failure with autoplay so I can't say the same.

@adamosborne83
Copy link

Damnnnnnnn..... I know I suck up to Umbrella, but fuckkkkkkk..... he literally told you to fuck off and you're still commenting. Wild and fair play.... hopefully you'll fix his code 🤣🤣🤣

@umbrellaplug
Copy link
Owner

It failed to play with 6.6.629 on autoplay few times. I enabled debuging and now i cant reproduce it anymore :(

Can you please try version 6.6.630 with debug enabled and let me know if you have anymore issues?

@ambulancePilot
Copy link
Author

ambulancePilot commented Jul 27, 2024

Working fine (6.6.630) here with autoplay and source select for both movies and episodes.

@saxoloman
Copy link

Working fine now, i cant get it to fail with 6.6.630 no matter how much i tried.

@AdeHub
Copy link

AdeHub commented Jul 28, 2024

Working on macOS and Apple TV, thanks 🍺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants