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

'writethumbnail' not working? #2143

Closed
Elite opened this issue Jan 13, 2014 · 6 comments
Closed

'writethumbnail' not working? #2143

Elite opened this issue Jan 13, 2014 · 6 comments

Comments

@Elite
Copy link

@Elite Elite commented Jan 13, 2014

I am using this in my python code but thumbnails are not getting generated, am I missing something here?

ydl_options = {
            'outtmpl': '%(title)s-%(id)s.%(ext)s',
            'logger': Logger(),
            'nooverwrites': True,
            'writethumbnail': True,
        }


        with YoutubeDL(ydl_options) as ydl:
            ydl.add_default_info_extractors()
            info = ydl.extract_info(self.url,False)
@Elite
Copy link
Author

@Elite Elite commented Jan 13, 2014

OK, this works when downloading video but not as an option for info extraction.

@Elite Elite closed this Jan 13, 2014
@ghost
Copy link

@ghost ghost commented Jan 13, 2014

You have thumbnail url in info dict.

@Elite
Copy link
Author

@Elite Elite commented Jan 13, 2014

@pulpe Yeah, I am aware of that wanted YTDL to do the thumb downloading.

@phihag
Copy link
Contributor

@phihag phihag commented Jan 13, 2014

Reopening, this is a bug in youtube-dl.

@phihag phihag reopened this Jan 13, 2014
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jan 13, 2014

As a trick I think you can set skip_downloadto True and the video itself won't be downloaded, while the thumbnail will be downloaded (you can also use it to only write the info.json).

@phihag
Copy link
Contributor

@phihag phihag commented Jan 13, 2014

The problem is with your invocation - when you pass in False as the second parameter to extract_info, you're disabling any and all downloading. Instead, just set skip_download to True. The following works for me:

from youtube_dl import YoutubeDL
url = 'BaW_jenozKc'


class Logger(object):
    def debug(self, msg):
        print(msg)

    def error(self, msg):
        print(msg)


ydl_options = {
    'outtmpl': '%(title)s-%(id)s.%(ext)s',
    'logger': Logger(),
    'nooverwrites': True,
    'writethumbnail': True,
    'skip_download': True,
}

with YoutubeDL(ydl_options) as ydl:
    ydl.add_default_info_extractors()
    info = ydl.extract_info(url)
@phihag phihag closed this Jan 13, 2014
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.