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

Error downloading redgifs: TypeError: can only concatenate str (not "NoneType") to str #3116

Closed
rostam-rakhsh opened this issue Oct 28, 2022 · 1 comment

Comments

@rostam-rakhsh
Copy link

I'm calling the command:

    cmd = f'gallery-dl {url} -d {save_path_dir}'
    sp.call(cmd,shell=True)

Where url is 'https://www.redgifs.com/watch/defenselessbaggyhellbender' and save_path_dir is 'Downloads/saved_reddit/' and I'm getting this issue. Same kind of issue with any other downloader I'm using for redgifs.

Verbose output below:

[gallery-dl][debug] Version 1.23.3
[gallery-dl][debug] Python 3.8.6 - macOS-10.14.6-x86_64-i386-64bit
[gallery-dl][debug] requests 2.28.1 - urllib3 1.26.10
[gallery-dl][debug] Starting DownloadJob for 'https://www.redgifs.com/watch/defenselessbaggyhellbender'
[redgifs][debug] Using RedgifsImageExtractor for 'https://www.redgifs.com/watch/defenselessbaggyhellbender'
[redgifs][debug] Retrieving Bearer token
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.redgifs.com:443
[urllib3.connectionpool][debug] https://www.redgifs.com:443 "GET / HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://www.redgifs.com:443 "GET /assets/js/index.cba1e339.js HTTP/1.1" 200 None
[redgifs][error] An unexpected error occurred: TypeError - can only concatenate str (not "NoneType") to str. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[redgifs][debug] 
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/gallery_dl/job.py", line 82, in run
    for msg in extractor:
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/gallery_dl/extractor/redgifs.py", line 36, in items
    for gif in self.gifs():
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/gallery_dl/extractor/redgifs.py", line 127, in gifs
    return (RedgifsAPI(self).gif(self.key),)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/gallery_dl/extractor/redgifs.py", line 137, in __init__
    "authorization": "Bearer " + self._fetch_bearer_token(extractor),
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/gallery_dl/cache.py", line 115, in __call__
    value = self.func(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/gallery_dl/extractor/redgifs.py", line 182, in _fetch_bearer_token
    token = "ey" + text.extract(page, '="ey', '"')[0]
TypeError: can only concatenate str (not "NoneType") to str
@mikf
Copy link
Owner

mikf commented Oct 29, 2022

Duplicate of #3080 (which is pinned).
Will be fixed in the next release.

@mikf mikf closed this as completed Oct 29, 2022
@mikf mikf added the duplicate label Oct 29, 2022
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

2 participants