dirkjanm / firefox-send-to-xbmc

Send to XBMC/Kodi Firefox plugin
MIT License
65 stars 26 forks source link

accidental hooktube.com support, maybe? #64

Open geeseven opened 6 years ago

geeseven commented 6 years ago

The regex for youtube is picking up hooktube, possibly on accident? The following is the current explanation how hooktube works:

Share YouTube videos without giving them views. Bypass country blocks and age restrictions. Download YouTube videos and music. Keep your data private from the G.

HOW: Just replace the domain in any YT link with hooktube.com and you get a light-weight page that loads YouTube's media files (mp4, webm, etc) directly into your browser's native media player. https://youtube.com/watch?v=S6bOkFLrsAc becomes https://hooktube.com/watch?v=S6bOkFLrsAc, etc. Supported parameters: start, end, loop (1 for on), speed (range: 0.01 to 4), autoplay (0 for off, default is 1).

When opening both the example youtube and hooktube links with firefox-send-to-xbmc it appears to play the same video via the kodi youtube plugin. It kinda hard to tell as the video links in the kodi logs are very long and critic. If you right click on the video and select Copy Video Location on hooktube page, it produces a very similar looking link.

I do not know if hooktube and the youtube plugin use similar methods. If they do, this might not be a bug.

dirkjanm commented 6 years ago

Send to kodi supports native video elements, it can send the media url to Kodi. On YouTube it sends the URL to the Kodi YouTube plugin, it is possible that since hooktube gets the direct URL that it sends that one to Kodi. Why would this be a bug though if it works?

geeseven commented 6 years ago

Hey @dirkjanm,

Thanks for the timely reply.

I do not think native video element support is how hooktube videos are working. If I right click -> Send to Kodi on a video from this page, I get the following in the kodi logs:

09:26:31.355 T:3018960896  NOTICE: VideoPlayer: Opening: https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4

If I right click -> Send to Kodi on the video from the example hooktube page, it results in the following error:

Send to Kodi - Error
The following use is not supported:
https://redirector.googlevideo.com/videoplayback... (long URL trimmed)

If I right click -> Send to Kodi the example hooktube link itself, I get the following in the Kodi logs:

09:57:15.763 T:2405430176  NOTICE: [plugin.video.youtube] Running: YouTube (6.0.2) on Krypton (Kodi-17.6) with Python 2.7.13
                                                Path: /play/
                                                Params: {'video_id': 'S6bOkFLrsAc'}

...

09:57:18.627 T:3018960896  NOTICE: VideoPlayer: Opening: https://r1---sn-q4fl6nle.googlevideo.com/videoplayback.... (long URL trimmed)

It would appear that hooktube links are getting caught up in the youtube regex, given how similar they are.

Why would this be a bug though if it works?

This is a valid point. I found the behaviour unexpected. A non-yotube link was getting passed to the kodi youtube plugin. Given that hooktube and the kodi youtube plugin both produce a googlevideo.com link, it might not matter. That being said, I am not sure if changes are needed. Maybe just documentation?? Maybe this issue is enough, seeing that hooktube is pretty niche?? :man_shrugging:

Feel free to close if you feel this is not a bug and/or this issue itself is enough documentation regarding this behaviour. If needed, I can submit a pull request if you feel the README.md needs information about hooktube.

dirkjanm commented 6 years ago

Interesting, it does indeed seem that the regex is generic enough to catch the YouTube url even thought it is on a different domain. I'll have a look when I have time at hooktube and if it is possible to get the direct url in an easy way, otherwise it might just be enough to send it to the YouTube plugin instead since in the end the correct video should play.

geeseven commented 6 years ago

I'll have a look when I have time at hooktube

Feel free to prioritize as you see fit. Given hooktube's notoriety compared to the supported video platforms, I would not think twice if you rank this as low priority.

Thanks for a great plugin.