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

[Twitter]direct image error on DataJob #2030

Closed
rachmadaniHaryono opened this issue Nov 16, 2021 · 0 comments
Closed

[Twitter]direct image error on DataJob #2030

rachmadaniHaryono opened this issue Nov 16, 2021 · 0 comments
Labels

Comments

@rachmadaniHaryono
Copy link
Contributor

rachmadaniHaryono commented Nov 16, 2021

running following code will output error

from gallery_dl.job import DataJob
job = DataJob('https://pbs.twimg.com/media/EpeD5KqVoAAeJTC.jpg')
job.run()
print(job.data)

output

[ [ "TypeError", "_image_fallback() missing 1 required positional argument: 'base'" ] ]

this is caused by this line

"_fallback": TwitterExtractor._image_fallback(base),

possible solution

self._size_fallback = ("large", "medium", "small")
data = {
    "filename": self.id,
    "extension": self.fmt,
    "_fallback": TwitterExtractor._image_fallback(self, base),
}

e: or

def _image_fallback(self, base):
    for fmt in getattr(self, "_size_fallback", []):
        yield base + fmt
@mikf mikf added the bug label Nov 16, 2021
@mikf mikf closed this as completed in ab8eea1 Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants