Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add support for reversable filename format,filename -> url #6149
Comments
|
I think currently it's impossible. For most sites, it's impossible to infer the full URL from ID, as ID is only part of URL. For example, the following URL:
has ID For sites that URL is directly related to ID (for example youtube and bilibili as you've mentioned), I think write a simple script that maps IDs to URLs and feeds the URL to youtube-dl is enough. A new feature is added to youtube-dl only if it's impossible or too complicated to implement it outside youtube-dl. |
Consider youtube-dl have a predefined registry file
{ "registries": [ { "format": "www.youtube.com/watch?v=%s" }, { "format": "www.bilibili.com/video/av%d/" }, { "format": "www.bilibili.com/video/av%d/index_%d.html" } ] }For
https://www.youtube.com/watch?v=zKN_pnzIM7kmatch the registry id #0Save
to
Notice there is one more char
0,use base64-like,one char for 64bit,it's enough to handle registry id(maybe can use some bits for other use).For
http://www.bilibili.com/video/av2403515/match the registry id #1Save to
Consider there is a command
I thinks this is very useful.
The registry order should never change even the url format was changed,by add more meta info to registry will give more useful infos.