Open cheese529 opened 1 year ago
[reddit][debug] Using default API credentials (client-id 6N9uN0krSDE-ig)
It is still using the default and heavily rate limited client-id. Whatever you did to set your custom client-id had no effect, it seems.
Here's a minimal example that works:
{
"extractor": {
"reddit": {
"client-id": "CLIENTID_HERE",
"user-agent": "Python:<application name>:v1.0 (by /u/<username>)"
}
}
}
TypeError: _parse_browser_specification() takes from 1 to 4 positional arguments but 7 were given
This error is coming from yt-dlp. Your cookie settings there are probably not right or forward-cookies
does not work anymore.
thank you mikf, it seems to be using my own client-id now, copy pasting your example did the trick. also regarding the other issue it seems like there is a bug with yt-dlp where it fails to download and embed thumbnails for reddit, it downloads html instead of png so the file just fails to open or embed. we are just going to have to wait for them to fix the reddit extractor by using the header "Accept:image/png"
Here is the full fix for anyone else who might want to use it.
index 13615e82f..813e62874 100644
--- a/yt_dlp/extractor/reddit.py
+++ b/yt_dlp/extractor/reddit.py
@@ -240,6 +240,7 @@ def add_thumbnail(src):
'url': unescapeHTML(thumbnail_url),
'width': int_or_none(src.get('width')),
'height': int_or_none(src.get('height')),
+ 'http_headers': {'Accept': '*/*'},
})
for image in try_get(data, lambda x: x['preview']['images']) or []:```
Here's a minimal example that works:
{ "extractor": { "reddit": { "client-id": "CLIENTID_HERE", "user-agent": "Python:<application name>:v1.0 (by /u/<username>)" } } }
Thanks for the trick, @mikf !
Anyway, I'm getting this error while trying to refresh the token:
Then in the terminal I get:
Looks like it is working, but how do I understand if I'm using my own ID?
When it is using your custom client-id and is refreshing a private access token, it must be using your new refresh token.
[reddit][debug] Using custom API credentials (client-id NsuSQ*********)
[reddit][info] Refreshing private access token
You can also add this token to your config:
{
"extractor": {
"reddit": {
"client-id": "CLIENTID_HERE",
"user-agent": "Python:<application name>:v1.0 (by /u/<username>)",
"refresh-token": "TOKEN_HERE"
}
}
}
[reddit][debug] Using custom API credentials (client-id NsuSQ*****) [reddit][info] Refreshing private access token
Sorry, I don't think I got it. I have no coding skills so I probably missed some steps. I added a row in the reddit configuration:
"refresh-token": "TOKEN_HERE",
using the token previously given to me by the application itself (the one I blurred out in the last screenshot). Should I take it elsewhere? And what should I see after clicking 'Allow' on Reddit?
Thanks
using the token previously given to me by the application itself (the one I blurred out in the last screenshot).
That's the value you are supposed to put into the TOKEN_HERE place, yes.
And what should I see after clicking 'Allow' on Reddit?
You should get redirected to http://localhost:6414/
and see the same message that gets displayed in console, which for me is
Your 'refresh-token' is
XXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Put this value into your configuration file as
'extractor.reddit.refresh-token'
to use it.
Maybe it doesn't work properly on Windows anymore?
This refresh-token
is only necessary to access your account's saved posts, private subreddits, etc. Anything you need an actual account for. The important thing is a custom client-id
.
Maybe it doesn't work properly on Windows anymore?
Sorry, I didn't know I had to specify, but I'm on a Mac
Maybe I should stop retrying gallery-dl oauth:reddit
... but I thought I needed to complete everything well at least once 🤔
I mean, if you somehow got a refresh token value, even if your browser showed an error, then that's perfectly OK. The console output is what really matters here.
OK so I don't know exactly how to check if everything is working fine, but I guess it is (seems that downloads from Reddit are working). I'll just go on this way and I'll ask for help only if new issues emerge, thanks :)
Your 'refresh-token' is XXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Put this value into your configuration file as 'extractor.reddit.refresh-token' to use it.
Maybe it doesn't work properly on Windows anymore?
No, it's definitely still working on Windows, I've refreshed mine a couple of days ago.
It is all still working as usual!
@Roccobot From what I'm seeing here, it seems to work as expected.
I am having trouble downloading my saved posts after reddit released it's API changes. I followed Mikfs tutorial on adding my own custom client-id and everything else he listed but it still fails after downloading just a few saved posts, here is the verbose log.