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

Add support for reversable filename format,filename -> url #6149

Closed
wenerme opened this issue Jul 4, 2015 · 1 comment
Closed

Add support for reversable filename format,filename -> url #6149

wenerme opened this issue Jul 4, 2015 · 1 comment

Comments

@wenerme
Copy link

@wenerme wenerme commented Jul 4, 2015

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_pnzIM7k match the registry id #0
Save

World's Most Emotional & Powerful Music _ 2-Hours Epic Music Mix - Vol.1-zKN_pnzIM7k.f137.mp4

to

World's Most Emotional & Powerful Music _ 2-Hours Epic Music Mix - Vol.1-0zKN_pnzIM7k.f137.mp4

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 #1
Save to

Don't care the name-12403515.mp4

Consider there is a command

> youtube-dl --url 'Don't care the name-12403515.mp4'
http://www.bilibili.com/video/av2403515/

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.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 4, 2015

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:

http://www.discovery.com/tv-shows/mythbusters/videos/mission-impossible-outtakes.htm

has ID mission-impossible-outtakes

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.

@yan12125 yan12125 closed this Jul 4, 2015
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
2 participants
You can’t perform that action at this time.