-
Notifications
You must be signed in to change notification settings - Fork 30
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
Comments
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. |
Thank you so much. It's rare to find a file named like this... figures it's
a Kardashian episode 🙄
Thanks again.
…On Tue, Jul 16, 2024, 8:23 a.m. umbrellaplug ***@***.***> wrote:
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.
—
Reply to this email directly, view it on GitHub
<#380 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATRPQUQVCVF72AJNFTP7LTLZMUGDFAVCNFSM6AAAAABK5L5QLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZQG42TKOBTGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I figured if it meant enough to you to admit you were watching Kardashians then I could at least fix it. |
Hahahaha. One year ago I'd have relentlessly made fun of anyone watching
this. The other half is into it and I've been watching with him. It's
pretty bad.
…On Tue, Jul 16, 2024, 12:06 p.m. umbrellaplug ***@***.***> wrote:
I figured if it meant enough to you to admit you were watching Kardashians
then I could at least fix it.
😆
—
Reply to this email directly, view it on GitHub
<#380 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATRPQURO4JTHESAQFAIDHWLZMVAGZAVCNFSM6AAAAABK5L5QLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZRGMYTCNBSHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Oh my. To be honest I don't really watch many movies, so I didn't even
think to test with that case. That's so strange! Very hard to imagine how
that could happen.
I'll do my best to back trace the error related to playing movies and share
what I can, if I find anything.
Can you share what other things have broken? It might help.
I always enjoy a good problem!
…On Tue, Jul 16, 2024, 3:27 p.m. umbrellakodi ***@***.***> wrote:
This actually breaks a lot of things. After making this change no movies
play from real-debrid. I don't know how you have this working to be honest.
—
Reply to this email directly, view it on GitHub
<#380 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATRPQUUP2USLWEQVMG3ESXDZMVX3XAVCNFSM6AAAAABK5L5QLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZRGY4DCMJVGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Oh I see! I think I might know how to address it in that case, but I don't
want to speak too early and out of turn. Of course the problem isn't really
how to solve the issue, but how to solve it without breaking other things.
If you're able to figure anything out please let me know.
In my view it's something that deserves a fixing because in some cases
autoplay doesn't work because the number one source has spaces in the file
name.
On top of that, because it's not a failure to resolve, it doesn't try the
next source. It resolves but it doesn't play, and there's no code to handle
that case.
…On Tue, Jul 16, 2024, 3:41 p.m. umbrellakodi ***@***.***> wrote:
It broke the resolve function in real debrid and the remove magnet due to
the information no longer matching.
—
Reply to this email directly, view it on GitHub
<#380 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATRPQUVTP6Q5BW3EDQ2VMW3ZMVZNRAVCNFSM6AAAAABK5L5QLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZRG4YDCNJQGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
That's no problem, I'll do my best to sort it out and share if I have a
viable fix.
…On Tue, Jul 16, 2024, 4:04 p.m. umbrellakodi ***@***.***> wrote:
Really falls back to bad naming for files. It's pretty standard practice
not to put spaces in file names. I'll see what I can do, but I'm being very
honest when I say it's not something I'll invest a large amount of time
into fixing.
—
Reply to this email directly, view it on GitHub
<#380 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATRPQURTZ7DFINTJU5OVEGLZMV4DFAVCNFSM6AAAAABK5L5QLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZRG4ZTINJYGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
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:
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. |
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? |
"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. |
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. |
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. |
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: 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. |
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. |
Thank you for your candor.
You might be on to something. I have only tested this on a fire stick 4K
max. I do have Kodi installed on my Windows laptop so I will give that a go
when I get a chance, but it will have to be tomorrow.
One thing I'd be curious to know is with that Kardashians episode I
mentioned, if you're sure it's the same magnet, what URL does the log show
after OpenFile?
Does the URL have spaces in it as per the file name or has it been
manipulated in some?
…On Wed, Jul 17, 2024, 5:08 p.m. umbrellaplug ***@***.***> wrote:
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.
—
Reply to this email directly, view it on GitHub
<#380 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATRPQUXWU63YQUE5TRM452LZM3MLFAVCNFSM6AAAAABK5L5QLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZUGI4TKNBQGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi I possibly have the same issue on Apple TV
Edit: also doesn't play on my MacBook |
Same with coreelec |
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.
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? |
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. |
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. |
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. |
Apple TV no issue either. Am I trying the wrong files here? |
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. |
Works on coreelec. |
Will check autoplay when I get home. :( |
This is why I get paid the big $$$. I'll see what's happening with autoplay. There's an issue here for sure. |
yeah, getting an error with autoplay |
I believe I have this fixed. I will be pushing a new version out. kodifitzwell was on the right track. |
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: after quoteplus this would be changed to: after requote_uri it would be changed to: 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)
Hopefully this makes sense. I feel like I'm ranting. |
Not working with source select https://paste.kodi.tv/agibegafol |
Unfortunately not working with autoplay either. |
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 |
Will get you a log in one sec. |
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://www.online-python.com/03nuMyZ7lE It's because fire stick and the other devices need spaces converted to %20 instead of + symbols. 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! |
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. |
@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. |
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. |
@AdeHub @saxoloman Can you guys please test 6.6.628 with auto-play and source select on your many janky devices? |
Works fine with both source select and autoplay on coreelec. |
Working on macOS And Apple TV |
@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. |
Autoplay and source select both working for episodes and movies. This is on fire stick. Great work! If willing, please explain your fix? |
It failed to play with 6.6.629 on autoplay few times. |
I haven't had a single failure with autoplay so I can't say the same. |
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 🤣🤣🤣 |
Can you please try version 6.6.630 with debug enabled and let me know if you have anymore issues? |
Working fine (6.6.630) here with autoplay and source select for both movies and episodes. |
Working fine now, i cant get it to fail with 6.6.630 no matter how much i tried. |
Working on macOS and Apple TV, thanks 🍺 |
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
The text was updated successfully, but these errors were encountered: