coletdjnz / yt-dlp-youtube-oauth2

[OBSOLETE] Plugin that adds OAuth2 login support to yt-dlp's YouTube extractors
The Unlicense
260 stars 38 forks source link

refreshing OAuth2 token failed. #2

Closed winneratwin closed 10 months ago

winneratwin commented 11 months ago

here are the logs. haven't done anything to break it i would think.

[debug] Command-line config: ['--download-archive', '/home/winner/Docker/airsonic-advanced/music/youtube-dl/downloaded.txt', '--no-post-overwrites', '-ciwx', '--audio-format', 'mp3', '-o', '/home/winner/Docker/airsonic-advanced/music/youtube-dl/%(title)s[%(id)s].%(ext)s', '--username', 'PRIVATE', '--password', 'PRIVATE', 'https://www.youtube.com/playlist?list=PLp6Varrr_r9GYgJQgWB_QOMQTy9o9A7w_', '--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.11.16 from yt-dlp/yt-dlp [24f827875] (pip)
[debug] Python 3.9.2 (CPython aarch64 64bit) - Linux-6.1.21-v8+-aarch64-with-glibc2.31 (OpenSSL 1.1.1w  11 Sep 2023, glibc 2.31)
[debug] exe versions: ffmpeg 4.3.6-0, ffprobe 4.3.6-0
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, certifi-2020.06.20, mutagen-1.47.0, requests-2.25.1, sqlite3-3.34.1, urllib3-1.26.5, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Extractor Plugins: oauth2 (YoutubeBaseInfoExtractor), oauth2 (YoutubeClipIE), oauth2 (YoutubeConsentRedirectIE), oauth2 (YoutubeFavouritesIE), oauth2 (YoutubeIE), oauth2 (YoutubeMusicSearchURLIE), oauth2 (YoutubeNotificationsIE), oauth2 (YoutubeSearchDateIE), oauth2 (YoutubeSearchIE), oauth2 (YoutubeSearchURLIE), oauth2 (YoutubeTabBaseInfoExtractor), oauth2 (YoutubeTabIE)
[debug] Plugin directories: ['/home/winner/.local/lib/python3.9/site-packages/yt_dlp_plugins']
[debug] Loaded 1901 extractors
[debug] Loading archive file '/home/winner/Docker/airsonic-advanced/music/youtube-dl/downloaded.txt'
[debug] Loading youtube-oauth2.token_data from cache
[youtube:tab+oauth2] Access token expired, refreshing
[youtube:tab+oauth2] oauth2: Refreshing OAuth2 Token
ERROR: PLp6Varrr_r9GYgJQgWB_QOMQTy9o9A7w_: An extractor error has occurred. (caused by KeyError('refresh_token')); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "/home/winner/.local/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 712, in extract
    self.initialize()
  File "/home/winner/.local/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 618, in initialize
    self._perform_login(username, password)
  File "/home/winner/.local/lib/python3.9/site-packages/yt_dlp_plugins/extractor/youtubeoauth.py", line 163, in _perform_login
    self.initialize_oauth()
  File "/home/winner/.local/lib/python3.9/site-packages/yt_dlp_plugins/extractor/youtubeoauth.py", line 53, in initialize_oauth
    token_data = self.refresh_token(token_data['refresh_token'])
  File "/home/winner/.local/lib/python3.9/site-packages/yt_dlp_plugins/extractor/youtubeoauth.py", line 101, in refresh_token
    'refresh_token': token_response['refresh_token'],
KeyError: 'refresh_token'
coletdjnz commented 10 months ago

Fixed, thanks!