konkor / you2ber

Gnome youtube-dl frontend
GNU General Public License v3.0
30 stars 4 forks source link

Add basic support for Youtube Music playlists #12

Closed craysiii closed 6 years ago

craysiii commented 6 years ago

Hey there.

Added some basic regex to change Youtube Music links to regular Youtube ones. Let me know what you think.

konkor commented 6 years ago

Nice. Can you provide an sample of such links to understand what is about? I'm not a pro YouTube user :) Thanks.

konkor commented 6 years ago

@craysiii Looks like I have understand what links...

  1. Here is this.is_y2b (link) for such things (https://github.com/konkor/you2ber/blob/master/extension.js#L152).
  2. I think it would be better just fix this checking (https://github.com/konkor/you2ber/blob/master/extension.js#L156)
    // if (res && !(uri.host == "www.youtube.com" || uri.host == "youtu.be")) res = false;
    // to just something like this:
    if (res && !(uri.host.indexOf ("youtube.com") > -1 || uri.host == "youtu.be")) res = false;
    // because, actually, youtube-dl supporting music.youtube.com links

    You can apply the changes and I'll merge it. you found it. Thanks again.

konkor commented 6 years ago

Actually, youtube-dl is supporting a lot video services like vimeo, flickr, dailymotion not only yt. full video services list here https://rg3.github.io/youtube-dl/supportedsites.html

craysiii commented 6 years ago

Hey @konkor , sorry for the late reply. Thanks for the prompt response.

I'll go ahead and make the changes in the morning (for me). Maybe a fork of this project to target general media sites supported by youtube-dl could be something to work towards? I still have to study youtube-dl to see how it works, but I'm sure there must be a list somewhere in that project that we could compare the copied URI with in order to determine if it's supported by the library or not. Let me know how you feel about that.

konkor commented 6 years ago

You can do anything you want. It's up to you.

craysiii commented 6 years ago

Sorry it took so long, but I've amended the commit to have the changes requested.

konkor commented 6 years ago

@craysiii nice. Also youtube-dl needs updating but the solution not merged to master branch yet. I'll make a update-checker and push all together to a new version of the extension.