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

progress_hook and already downloaded videos? #2144

Open
Elite opened this issue Jan 13, 2014 · 8 comments
Open

progress_hook and already downloaded videos? #2144

Elite opened this issue Jan 13, 2014 · 8 comments

Comments

@Elite
Copy link

@Elite Elite commented Jan 13, 2014

While using the below code and listening to progress_updates, no information is pushed either to Logger object neither anything gets updated in progress_hook(pr) telling that video is already downloaded. How to get that information?

Wouldn't it be good to emit an finished status to progress_hook in such a condition?

directory = os.path.join(os.path.expanduser('~'), 'Desktop')
        ydl_options = {
            'outtmpl': os.path.join(directory, '%(title)s-%(id)s.%(ext)s'),
            'logger': Logger(),
            'nooverwrites': True,
            'continuedl': True,
        }

        with YoutubeDL(ydl_options) as ydl:
            ydl.add_default_info_extractors()
            ydl.add_progress_hook(progress_hook)
            ydl.download([self.url])
@Elite
Copy link
Author

@Elite Elite commented Jan 15, 2014

2 days no reply, any idea guys?

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jan 15, 2014

The problem is you are setting 'nooverwrites', if you don't set it, you'll get the message [download] {filename} has already been downloaded. The progress_hook sent will have status set to download, we could set another status.

@Elite
Copy link
Author

@Elite Elite commented Jan 15, 2014

@jaimeMF I guess finished should be a better consistent status.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jan 15, 2014

Sorry, it's actually finished, i was thinking about setting it to already_downloaded, to make if different.

@Elite
Copy link
Author

@Elite Elite commented Jan 15, 2014

How about emitting already_downloaded while extracting only video information?

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jan 22, 2014

We currently only use the progress hook in the downloaders, we could add it (maybe extraction_finished would be better), but please, open a new issue for that.

jaimeMF added a commit that referenced this issue Jan 22, 2014
…f the file has already been downloaded (closes #2144)
@yasoob
Copy link
Contributor

@yasoob yasoob commented Feb 8, 2014

If this issue is solved then @phihag we can close it.

@Elite Elite closed this Feb 9, 2014
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Feb 9, 2014

This haven't been added yet, reopening.

@jaimeMF jaimeMF reopened this Feb 9, 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.