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

some trailers requiere being 18 years old #25

Open
hectorzin opened this issue Apr 7, 2022 · 1 comment
Open

some trailers requiere being 18 years old #25

hectorzin opened this issue Apr 7, 2022 · 1 comment

Comments

@hectorzin
Copy link

look for this errror, how can it be fixed?

2022-04-07 13:30:12,987 - INFO - downloading The Unbearable Weight of Massive Talent from RggMxPaoQSc
[youtube] RggMxPaoQSc: Downloading webpage
[youtube] RggMxPaoQSc: Refetching age-gated info webpage
WARNING: unable to download video info webpage: HTTP Error 410: Gone
ERROR: Sign in to confirm your age
This video may be inappropriate for some users.
Traceback (most recent call last):
File "theaterTrailers.py", line 231, in updateCache
if jsonDict[passedSmallTitle]['url'] == string:
KeyError: 'theunbearableweightofmassivetalent'

@hectorzin
Copy link
Author

Solved:

The solution is to pass a cookie to YouTube as part of the download process in YouTube-DL. I was able to accomplish that with the following steps.

I installed the Get Cookies extension in Chrome. This extension allows users to export cookies for a site as a text file.
I then visited YouTube.com, while I was logged in, and clicked on the Get
Cookies icon. Then I clicked on the “Export” button to download my YouTube cookies as a text file.
This created a youtube.com_cookies.txt file that I then copied into the theatertrailers folder

i Modified this in the theatertrailers.py file

Downloads the video, names it and copies the resources to the folder

def videoDownloader(string, passedTitle, yearVar):

Options for the video downloader

ydl1_opts = {
'outtmpl': os.path.join(TheaterTrailersHome, 'Trailers', '{0} ({1})'.format(passedTitle, yearVar), '{0} ({1}).mp4'.format(passedTitle, yearVar)),
'ignoreerrors': True,
'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best',
'cookiefile': os.path.join(TheaterTrailersHome,'youtube.com_cookies.txt'),
}

The cookiefile line is what I added

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

No branches or pull requests

1 participant