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

Retrieve Youtube storyboards (closes #9868) #14951

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MarcAbonce
Copy link

@MarcAbonce MarcAbonce commented Dec 11, 2017

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

This PR adds 2 related options: --list-storyboards and --write-storyboards.
This allows users to list or download a YouTube video's storyboards. Storyboards are grids of those small images that appear when hovering the cursor over a video's timeline.
Issue #9868 gives more details on this feature. This PR should close that issue.

YouTube has multiple versions of the storyboard (specified in the url), which differ by size and by number of frames per image file. Usually, though, there's a default version which is a single 10x10 image, like this.

This options only support YouTube for now, but many video sharing websites have a similar feature, so support for those could be easily added afterwards.

youtube_dl/YoutubeDL.py Outdated Show resolved Hide resolved
youtube_dl/YoutubeDL.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
youtube_dl/extractor/youtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/youtube.py Outdated Show resolved Hide resolved
youtube_dl/extractor/youtube.py Outdated Show resolved Hide resolved
@dstftw
Copy link
Collaborator

dstftw commented Dec 15, 2017

  1. Add documentation in extractor/common.
  2. Add storyboard meta field similar to thumbnail.

@MarcAbonce
Copy link
Author

I just updated with the required fixes.

youtube_dl/YoutubeDL.py Outdated Show resolved Hide resolved
youtube_dl/YoutubeDL.py Outdated Show resolved Hide resolved
youtube_dl/YoutubeDL.py Outdated Show resolved Hide resolved
youtube_dl/options.py Outdated Show resolved Hide resolved
@MarcAbonce
Copy link
Author

I updated with the requested changes.

The _write_thumbnails function needs to be called for both thumbnails and storyboards, though, in case a user wants to download both. So I can't see how would you completely avoid duplicating that call.

I also removed the unit tests I had added originally because I noticed that YouTube stopped returning the storyboards for a couple of days earlier this month, so it seems like we can't always rely on them being available. It looks like the extractor doesn't unit test for thumbnails either, so I hope this isn't a problem.

@johnyoonh
Copy link

johnyoonh commented Jul 31, 2018

Even if Youtube does not return the proper value. I think this option will be very helpful. @MarcAbonce I am interested in making changes.

@MarcAbonce
Copy link
Author

@johnyoonh, sure, feel free to open an issue or a PR to my branch if you want to make changes for this pull request.

@johnyoonh
Copy link

johnyoonh commented Oct 11, 2018

@dstftw Is this PR not acceptable?

@MarcAbonce
Copy link
Author

I just updated this PR with some fixes. Everything should be working correctly now.
If there's still anything that needs to be fixed, I'd appreciate any feedback.

@WinXaito
Copy link

Hello,

Where is this PR? I would be interested to have access to this feature.

Thank you

@MarcAbonce
Copy link
Author

@WinXaito, right now you can pull the code from my repo and checkout the storyboards branch.

You can also install it with pip as git+git://github.com/MarcAbonce/youtube-dl.git@storyboards although the installation is really slow. Since this code is not merged yet, I occasionally update and rebase the branch. When that happens, you would have to force an update or just uninstall and reinstall again.

@tfabris
Copy link

tfabris commented Jan 17, 2020

@MarcAbonce @dstftw - If I'm reading this thread right, this code is not yet pulled into the main branch because we're waiting on a resolution of some questions about a code review, between you two kind folks. I think this has been sitting here for a while, though, like, over a year, correct? Seems a bit long to wait for a code review. 😃

Man, I'd really like this feature in the mainline. I know that I can do a pull of the code and build my own, but with my current use-case, having it in the mainline would be so much nicer!

What can we do to poke this farther along?

Thanks for working on this feature!

@MarcAbonce MarcAbonce force-pushed the storyboards branch 3 times, most recently from 801ca07 to 64953f1 Compare January 22, 2020 08:00
@MarcAbonce
Copy link
Author

I rewrote my changes in the _write_thumbnails function to remove the code duplication problem and hopefully also make that part a little bit more straightforward. As far as I can tell, that was the only issue left from the code reviews.

@tfabris
Copy link

tfabris commented Jan 23, 2020

:)

@tfabris
Copy link

tfabris commented Apr 9, 2020

Hey @dstftw - Any word on approving this review?

Storyboards are grids of small images that appear when
the user hovers their cursor over a video's timeline.
See related issue ytdl-org#9868.

Options added:
  * --list-storyboards
  * --write-storyboards

Co-authored by @benob (See: #1)
@MarcAbonce
Copy link
Author

For anyone that's still interested in this feature, while this repo was down I started working on a separate library to include this feature alone. Now it's available as thumbframes_dl in PyPI: https://pypi.org/project/thumbframes-dl and in GitHub: https://github.com/MarcAbonce/thumbframes_dl

I'm still keeping this PR open in case there's still some interest in ever adding this feature to youtube-dl.

pukkandan pushed a commit to yt-dlp/yt-dlp that referenced this pull request Jun 13, 2021
This downloader is intended to be used for streams that consist of a
timed sequence of stand-alone images, such as slideshows or thumbnail
streams

This can be used for implementing:

ytdl-org/youtube-dl#4974 (comment)
ytdl-org/youtube-dl#4540 (comment)
ytdl-org/youtube-dl#11185 (comment)

ytdl-org/youtube-dl#9868
ytdl-org/youtube-dl#14951


Authored by: fstirlitz
@pukkandan pukkandan mentioned this pull request Nov 5, 2021
4 tasks
pukkandan added a commit to yt-dlp/yt-dlp that referenced this pull request Nov 16, 2021
Lesmiscore added a commit to ytdl-patched/ytdl-patched that referenced this pull request Nov 17, 2021
gaming-hacker pushed a commit to gaming-hacker/yt-dlp that referenced this pull request Nov 17, 2021
nixxo pushed a commit to nixxo/yt-dlp that referenced this pull request Nov 22, 2021
This downloader is intended to be used for streams that consist of a
timed sequence of stand-alone images, such as slideshows or thumbnail
streams

This can be used for implementing:

ytdl-org/youtube-dl#4974 (comment)
ytdl-org/youtube-dl#4540 (comment)
ytdl-org/youtube-dl#11185 (comment)

ytdl-org/youtube-dl#9868
ytdl-org/youtube-dl#14951


Authored by: fstirlitz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants