bellingcat / auto-archiver

Automatically archive links to videos, images, and social media content from Google Sheets (and more).
https://pypi.org/project/auto-archiver/
MIT License
578 stars 60 forks source link

Sign in to confirm you're not a bot - YouTube #150

Open djhmateer opened 2 months ago

djhmateer commented 2 months ago

Hi

I've been following this bug in yt-dlp where YouTube is now blocking downloads:

https://github.com/yt-dlp/yt-dlp/issues/10128

I've implemented the OAuth2 workaround: https://github.com/yt-dlp/yt-dlp/issues/10128#issuecomment-2157140324

It is working from a residential IP address server. (got banned from Azure server)

If anyone has other success (from Cloud servers?) that would be good to know about.

Also if you need archiving from one of my servers please get in touch. dave@hmsoftware.co.uk

Regards Dave

msramalho commented 2 months ago

Also following the issue mentioned.

Current suggestion is to try the oauth2 plugin or rotate your IP (advice is to use residential proxies rather than VPNs).

djhmateer commented 1 month ago

As of release 2024.10.22 of yt-dlp, it has the OAuth flow built in. https://github.com/yt-dlp/yt-dlp/wiki/Extractors#logging-in-with-oauth

pipenv update

# check which version you are using
pipenv shell

yt-dlp --version

# note that the new version just needs oauth and not oauth2 at the end of the config line

# youtubedl_archiver.py
ydl_options = {'outtmpl': os.path.join(ArchivingContext.get_tmp_dir(), f'%(id)s.%(ext)s'), 'quiet': False, 'noplaylist': not self.allow_playlist , 'writesubtitles': self.subtitles, 'writeautomaticsub': self.subtitles, "live_from_start": self.live_from_start, "proxy": self.proxy, "max_downloads": self.max_downloads, "playlistend": self.max_downloads, "username": "oauth", "password": ""}