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

What if some extractors have their own DEFAULT_OUTTMPL? #20544

Closed
sheerluck opened this issue Apr 3, 2019 · 5 comments
Closed

What if some extractors have their own DEFAULT_OUTTMPL? #20544

sheerluck opened this issue Apr 3, 2019 · 5 comments

Comments

@sheerluck
Copy link

@sheerluck sheerluck commented Apr 3, 2019

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

Description of your issue, suggested solution and other information

In YoutubeDL.py in def prepare_filename(self, info_dict) in line 660

outtmpl = self.params.get('outtmpl', DEFAULT_OUTTMPL)

outtmpl does not depend on value of "extractor" key in template_dict
So outtmpl is '%(title)s-%(id)s.%(ext)s' most of the time

And it's perfectly fine

But when extractor is "Imgur", well... it would be nice to have outtmpl equal '%(playlist_title)s-%(id)s.%(ext)s'

Something like this:

            def from_extractor(default, info):
                if info["extractor"] == "Imgur":
                    return '%(playlist_title)s-%(id)s.%(ext)s'
                return default

If you run $ youtube-dl https://imgur.com/gallery/gH2YifC you will get

[download] Destination: Imgur-PMVKzz1.mp4

When I run my patched youtube-dl I get

[download] Destination: Message in a bottle-PMVKzz1.mp4

Who knows, maybe other extractors have more suitable DEFAULT_OUTTMPL as well, right?

@sheerluck
Copy link
Author

@sheerluck sheerluck commented Apr 3, 2019

oh and this bug too:

$ youtube-dl https://imgur.com/gallery/HvW5QyI
[imgur:gallery] HvW5QyI: Downloading JSON metadata
[download] Downloading playlist: ¯\_(ツ)_/¯
[imgur:gallery] playlist ¯\_(ツ)_/¯: Collected 1 video ids (downloading 1 of them)
[download] Downloading video 1 of 1
[Imgur] FzIfHVd: Downloading webpage
[download] Destination: ¯_(ツ)_¯-FzIfHVd.mp4
[download] 100% of 880.96KiB in 00:00
[download] Finished downloading playlist: ¯\_(ツ)_/¯

Destination should be ¯\_(ツ)_/¯-FzIfHVd.mp4 and not ¯_(ツ)_¯-FzIfHVd.mp4

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Apr 3, 2019

oh and this bug too:
Destination should be ¯_(ツ)/¯-FzIfHVd.mp4 and not ¯(ツ)_¯-FzIfHVd.mp4

not a bug, try to create the file manually.

@sheerluck
Copy link
Author

@sheerluck sheerluck commented Apr 3, 2019

I got [download] Destination: ¯⧹_(ツ)_⧸¯-FzIfHVd.mp4 with this:

image

@sheerluck
Copy link
Author

@sheerluck sheerluck commented Apr 3, 2019

works for both Windows and Linux.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 3, 2019

Duplicate of #3101.

@dstftw dstftw closed this Apr 3, 2019
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
3 participants
You can’t perform that action at this time.