ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
129.8k stars 9.79k forks source link

Youtube Channel profile picture download feature request. (--profile-picture) #28449

Open angentanewbe opened 3 years ago

angentanewbe commented 3 years ago

Description

Hi I am requesting a feature to download the profile pictures of Youtube channels. Although I know a way to download by just changing some values out of the profile link maybe you can program it in the youtube-dl for automation.

first open up a youtube channel for eg https://www.youtube.com/channel/UCNeOeCvRK0pDv3kKZj6xUFQ

now right click on profile picture and view it (In Firefox browser)

now you get a link in the opened tab https://yt3.ggpht.com/ytc/AAUvwniM79AKFrUQMLOgCRRRhESud3DikoGd3tbuAwQi=s88-c-k-c0x00ffffff-no-rj

by changing the value s88 to s1024 we get the full view of the profile picture

here is the edited link https://yt3.ggpht.com/ytc/AAUvwniM79AKFrUQMLOgCRRRhESud3DikoGd3tbuAwQi=s1024-c-k-c0x00ffffff-no-rj

you can automate the process and add the feature to youtube-dl. Use --profile-picture as the argument to be used for the extraction of image through youtube-dl.

Also some other suggestions for argument instead of --profile-picture --user-picture --picture --profile-photo --pp --photo

sbiviji commented 3 years ago

I found this issue and would love to contribute!

sbiviji commented 3 years ago

I had some questions while working on this. Is there a forum where I can talk with other developers about the issues I'm facing?

KJBurnett commented 1 year ago

@angentanewbe @sbiviji - I'm aware this has been open for some time now, but placing here for posterity. You can autonomously download the original un-cropped profile pictures of a youtube channel with this command yt-dlp.exe "https://www.youtube.com/@{channel}" --write-thumbnail --playlist-items 0

Or, download every single avatar/profile picture size, and banner sizes, posted to the channel using yt-dlp.exe "https://www.youtube.com/@{channel}" --write-all-thumbnails --playlist-items 0

Hopefully this helps some users looking to automate downloading the avatars and banners of youtube channels.

Original issue discussing this problem here: https://github.com/yt-dlp/yt-dlp/issues/1111

daniel-pg commented 1 year ago

@KJBurnett Is there a way to make this work on channels that still don't have any videos? I'm getting this error:

[youtube:tab] <channel URL>: Downloading webpage  
ERROR: [youtube:tab] <channel URL>: This channel has no uploads
dirkf commented 6 months ago

The channel thumbnail should be supported with the next YT extractor back-port/update

LiquidZulu commented 1 week ago

Is there a way to print the url of the thumbnail to the terminal as against downloading it as a file? yt-dlp <channel URL> --print "%(thumbnail)s" --skip-download --playlist-items 0 has no output, and yt-dlp <channel URL> --print "%(thumbnail)s" --skip-download --playlist-items 1 does the most recent video thumbnail.

dirkf commented 1 week ago

30839 ... if you were actually using yt-dlp ...

Probably, the channel thumbnail is not present or not called thumbnail. See answer [1] below.

However, the same question applies to yt-dl too, with a slightly different answer at [2].

  1. Output JSON and select the desired value using a JSON tool like jq.

  2. Since yt-dl doesn't have --print, use --get-filename --output "%(thumbnail)s", where thumbnail is the name of the item to be printed, but be aware that the value displayed will have been sanitised to be used as a filename.

LiquidZulu commented 1 week ago

oh, derp, didn't notice the repo name lol. Ty