-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Banner image is not taken into account #342
Comments
Thank you for reporting, this is indeed a problem. |
This is in fact "normal" behavior, see Lines 137 to 139 in 0b9bed5
We can have a look again whether google changed again the API and we can retrieve the banner again. |
Unfortunately Google's API hasn't still changed to support retrieving banners again. As an alternative we could use something like import requests
from bs4 import BeautifulSoup
import json
channel_url = "https://www.youtube.com/@danasherniles"
response = requests.get(channel_url)
soup = BeautifulSoup(response.content, 'html.parser')
for script in soup.find_all("script"):
if 'ytInitialData' in script.text:
json_data = json.loads(script.text.split(' = ')[1].rstrip(';'))
banner_url = json_data["header"]["pageHeaderRenderer"]["content"]["pageHeaderViewModel"]["banner"]["imageBannerViewModel"]["image"]["sources"][-1]["url"]
print(banner_url)
break |
Is this really worth it? I'm not against this, but it does look a bit fragile. And setting the banner image manually is not "that hard", so probably not the most priority issue to solve. That being said, I'm not against someone proposing a PR on this issue, just wondering which focus we should put on this issue. |
Yes, fragile... but seems to be the best we can do... and the banner is pretty important! |
This will come back with move to full yt-dlp in fact (see #177), yt-dlp nicely provides the banner. |
Looking at several of our latest Youtube channels I see that the banner image is never included in the corresponding zim file.
See, e.g.:
Edit: this happens both when an entire channel or playlists within a channel are selected.
The text was updated successfully, but these errors were encountered: