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

So Reddit is not supported yet ? #104

Closed
wankio opened this issue Sep 7, 2018 · 8 comments
Closed

So Reddit is not supported yet ? #104

wankio opened this issue Sep 7, 2018 · 8 comments

Comments

@wankio
Copy link
Contributor

wankio commented Sep 7, 2018

Today when i test reddit, it have this error

reddit: Conflicting values for 'client-id' and 'user-agent': override either both or none of them.

reddit: An unexpected error occurred: ValueError - substring not found. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
reddit: Traceback
Traceback (most recent call last):
  File "c:\users\gen31uc\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\job.py", line 64, in run
    for msg in self.extractor:
  File "c:\users\gen31uc\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\extractor\reddit.py", line 39, in items
    for url in self._urls(submissions):
  File "c:\users\gen31uc\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\extractor\reddit.py", line 63, in _urls
    for submission, comments in submissions:
  File "c:\users\gen31uc\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\extractor\reddit.py", line 258, in _pagination
    id_max = self._parse_id("id-max", 2147483647)
  File "c:\users\gen31uc\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\extractor\reddit.py", line 307, in _parse_id
    return self._decode(sid.rpartition("_")[2]) if sid else default
  File "c:\users\gen31uc\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\extractor\reddit.py", line 311, in _decode
    return util.bdecode(sid, "0123456789abcdefghijklmnopqrstuvwxyz")
  File "c:\users\gen31uc\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\util.py", line 90, in bdecode
    num += alphabet.index(c)
ValueError: substring not found
@Hrxn
Copy link
Contributor

Hrxn commented Sep 7, 2018

Well, it was working just fine before..
But yeah, Reddit got a site redesign pretty recently, and I think the official switch has been made not long ago. So that is probably the cause here..

@wankio
Copy link
Contributor Author

wankio commented Sep 7, 2018

ripme still work but it failed to merge audio, so i think tt has changed recently

mikf added a commit that referenced this issue Sep 7, 2018
Uppercase characters caused a ValueError exception
@mikf
Copy link
Owner

mikf commented Sep 7, 2018

The cause for this error was the value for id-max in the default config file, ZIK0ZJ, and its uppercase letters. _parse_id() and _decode() in the reddit module convert reddit submission IDs (like ZIK0ZJ) into actual numbers, but they expect lowercase letters. Anyways, it's fixed now (hopefully).

@wankio
Copy link
Contributor Author

wankio commented Sep 7, 2018

ty but when i test it

reddit: Conflicting values for 'client-id' and 'user-agent': override either both or none of them. reddit: Requesting public access token reddit: Authentication failed: "Unauthorized (401)"

@mikf
Copy link
Owner

mikf commented Sep 7, 2018

This is another issue caused by conflicting values in the default config file ... I should've tested them a bit better, sorry about that.

To get things working, either delete the general user-agent setting somewhere at the top of your config file, or set the user-agent for reddit to "Python:gallery-dl:0.8.4 (by /u/mikf1)". Both should work.

@wankio
Copy link
Contributor Author

wankio commented Sep 8, 2018

tested and worked now, thank you :)

  • But when i'm trying to rip this : https://www.reddit.com/r/BokuNoEroAcademia/
    seem like it deep analysis each post, if post have external source, it will download external source and put it in extractor folder. It should put all external folder inside reddit/bokunoeroacademia

  • If post external source is tumblr/twitter user link, not post link, it will download all like what it designed for user link tumblr,twitter,danboo,nhentai,...... it should focus only on post link and skip if it's user link (to avoid download hundred or thousand of files

@mikf
Copy link
Owner

mikf commented Sep 8, 2018

Set comments to 0 if you don't want it to go through user comments and get URLs from there as well.

The directory structure for Reddit downloads is a bit unfortunate, I agree, but "fixing" it isn't really possible with how things work internally. Getting this right is a goal for v2.0.0 for sure, but for right now you will have to manually set the base-directory to get it to do what you want.

$ gallery-dl -d BokuNoEroAcademia https://www.reddit.com/r/BokuNoEroAcademia/
# or
$ gallery-dl -o base-directory=BokuNoEroAcademia https://www.reddit.com/r/BokuNoEroAcademia/

@wankio
Copy link
Contributor Author

wankio commented Sep 8, 2018

ty u are awesome :) , that's what i'm thought

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

No branches or pull requests

3 participants