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

list supported domains #7090

Closed
kokoko3k opened this issue Oct 7, 2015 · 6 comments
Closed

list supported domains #7090

kokoko3k opened this issue Oct 7, 2015 · 6 comments

Comments

@kokoko3k
Copy link

@kokoko3k kokoko3k commented Oct 7, 2015

I'm writing a gui to mpv.
When using youtube-dl via mpv, trying to play a network stream without knowing in advance if it supported by youtube-dl or not , and so activating the ytdl hook on mpv may slow down the process (expecially on slow machines) of starting the play.
Is there a way to show a list of domains supported by youtube-dl so that a simple string match could be done in advance and choosing to use or not the ytdl hook within mpv?
--list-extractors does not show domains.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 7, 2015

That is not possible and here is why.

@dstftw dstftw closed this Oct 7, 2015
@kokoko3k
Copy link
Author

@kokoko3k kokoko3k commented Oct 7, 2015

As i see through the code, every extractor has a _VALID_URL variable.
Why listing that should not give a list of supported sites?
I did not talk about an an exhaustive list.

@kokoko3k
Copy link
Author

@kokoko3k kokoko3k commented Oct 7, 2015

Brute example of 10 supported sites (if not, bugreport them!):

#grep -R "VALID_URL"  ./|cut -d "=" -f 2|cut -d \' -f 2|grep '^http\:\|^https\:\|^https\?'|head -n 10
https?://(?:www|m)\.nuvid\.com/video/(?P<id>[0-9]+)
https?://www\.wayofthemaster\.com/([^/?#]*/)*(?P<id>[^/?#]+)\.s?html(?:$|[?#])
https?://videos\.toypics\.net/view/(?P<id>[0-9]+)/.*
http://videos\.toypics\.net/(?P<username>[^/?]+)(?:$|[?#])
https?://video(?P<team>\.[^.]*)?\.nhl\.com/videocenter/(?:console|embed)?(?:\?(?:.*?[?&])?)(?:id|hlg|playlist)
https?://(?:.+?\.)?nhl\.com/(?:ice|club)/news\.html?(?:\?(?:.*?[?&])?)id
https?://video\.(?P<team>[^.]*)\.nhl\.com/videocenter/(console\?[^(id
http://.*?\.defense\.gouv\.fr/layout/set/ligthboxvideo/base-de-medias/webtv/(?P<id>[^/?#]*)
https?://?(?:www\.)?escapistmagazine\.com/videos/view/[^/?#]+/(?P<id>[0-9]+)-[^/?#]*(?:$|[?#])
https?://(?:www\.)?gameone\.de/tv/(?P<id>\d+)

?

@phihag
Copy link
Contributor

@phihag phihag commented Oct 8, 2015

If you want any incomplete list, why not just hardcode those 10 lines?

I'm assuming that you really do not want any incomplete list, but instead, want to test whether a URL could be supported by youtube-dl. That is quite simple.

@kokoko3k
Copy link
Author

@kokoko3k kokoko3k commented Oct 8, 2015

I pasted 10 lines just to not flood the message.
I'll try to explain better my problem.

Use case is:
my mpv frontend trying to play a generic url on a slow netbook.
url is so generic that i don't know in advance if it is playable by plain mpv or needs to be parsed by mpv's ytdl hook.
I can let mpv do all of the work; it will try to use ytdl first, and if it fails it will fallback to ffmpeg.
It will work, but it is very, very slow (atom n270 here).

So i tried to do the opposite; using ffmpeg first, and if it failed, then fallback to ytdl.
The problem here, is that sometimes ffmpeg tries too hard to play webpages, spending a lot of time before failing.

The only way i could think to really speed up things (at least most of the times) is to know in advance if a site is (at least probably) supported by ytdl, so that on those sites i can first try ytdl, then ffmpeg; and do the opposite if i think the site is not supported.

By now i managed to create an incredibly brute and hacky command full of grep,sed,sort,awk that scans the youtube-dl code and creates a list of supported domains, and yes, i've hardcoded it into my mpv frontend code.

See the mess:
http://pastebin.com/b0pbvrMs

..it even works, but i'll have to regenerate the list everytime youtube-dl is updated with new extractors.

@arderyp
Copy link

@arderyp arderyp commented Oct 4, 2019

here's the answer: #4503

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.