question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error returned when trying on Patreon content

See original GitHub issue

Checklist

  • I’m reporting a broken site support
  • I’ve verified that I’m running youtube-dl version 2021.04.17
  • I’ve checked that all provided URLs are alive and playable in a browser
  • I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
  • I’ve searched the bugtracker for similar issues including closed ones

Verbose log

youtube-dl --write-sub -o "S%(season_number)02dE%(episode_number)02d - %(title)s.%(ext)s" -a youtube.txt --verbose
[debug] System config: ['--prefer-free-formats']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--write-sub', '-o', 'S%(season_number)02dE%(episode_number)02d - %(title)s.%(ext)s', '-a', 'youtube.txt', '--verbose']
[debug] Batch file urls: ['https://www.patreon.com/posts/tansjs-sunday-49973145']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.04.17
[debug] Python version 3.9.2 (CPython) - Linux-5.11.11-200.fc33.x86_64-x86_64-with-glibc2.32
[debug] exe versions: ffmpeg 4.3.2, ffprobe 4.3.2
[debug] Proxy map: {}
[Patreon] 49973145: Downloading JSON metadata
ERROR: An extractor error has occurred. (caused by KeyError('post_file')); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python3.9/site-packages/youtube_dl/extractor/patreon.py", line 148, in _real_extract
    post_file = attributes['post_file']
KeyError: 'post_file'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python3.9/site-packages/youtube_dl/extractor/patreon.py", line 148, in _real_extract
    post_file = attributes['post_file']
KeyError: 'post_file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 806, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/youtube_dl/YoutubeDL.py", line 827, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python3.9/site-packages/youtube_dl/extractor/common.py", line 547, in extract
    raise ExtractorError('An extractor error has occurred.', cause=e)
youtube_dl.utils.ExtractorError: An extractor error has occurred. (caused by KeyError('post_file')); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.


Description

I was trying to download a video to keep locally for storage on my media server for personal use and got this error that asked me to post here.

youtube-dl-error.txt

and the relevant section of the HTML which I belive is related to the error is attached here. The whole file contains far too much pii to post publicly.

youtubedl-test.txt

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
phoenixdigitalcommented, Apr 17, 2021

I tried uncommenting the login section of code in patreon.py but it didn’t work. It’s likely just a placeholder so I’ll have to leave the rest to someone who knows a bit more about making a login module. Digging into the login process the URL is

https://www.patreon.com/api/login

It accepts these POST fields

{"data":{"type":"user","attributes":{"email":"theusername","password":"thepassword"},"relationships":{}}}

There is a form of 2FA where they ask you to approve that PC for login via email. So not sure what “fingerprint” it uses to detect a unique PC. Possibly this cookie in the request header to that login page.

cookie: __cfduid=_______redacted_____; patreon_device_id=_______redacted_____; patreon_location_country_code=AU; __cf_bm=_______redacted_____; _ALGOLIA=anonymous-_______redacted_____; _fbp=_______redacted_____; patreon_locale_code=en-US; G_ENABLED_IDPS=google; group_id=_______redacted_____; _swb=_______redacted_____

So you’d probably want to allow the user to pass in a patreon_device_id so they don’t get forced with the 2FA everytime or cache it somewhere???

The response seems to set a cookie which might be used to keep the user logged in???

set-cookie: session_id=_____redacted______; Domain=patreon.com; Expires=Mon, 17-May-2021 22:--:00 GMT; Max-Age=2592000; Secure; HttpOnly; Path=/; SameSite=Lax

That’s about all I could find. Hope that helps.

0reactions
dirkfcommented, Aug 19, 2022

Also, if a page fails with yt-dl, it would be useful to know whether it works with yt-dlp, as that has a newer version of the extractor (but using some core functions not yet back-ported).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Found a problem with the site - Patreon Support
Having an issue with the site? There are a few troubleshooting steps we recommend that may resolve the issue. Retry your action after...
Read more >
Troubleshoot problems on the Patreon app
Step 1: Sign out of the Patreon app, and uninstall the app. Step 2: Restart your phone. Step 3: Once your phone is...
Read more >
Why can't I access posts? – Patreon Help Center
One of the benefits of becoming a patron is getting access to exclusive content via posts. If you're not getting access to posts,...
Read more >
Troubleshooting common RSS errors with your patrons
Power off and then restart your device. · Log out of your account on the Patreon app. · Log back in to the...
Read more >
Resolving issues with video posts – Patreon Help Center
If patrons are reporting receiving the message, “Video unavailable” for your YouTube videos in the Patreon app, it's likely because there is music...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found