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

Cannot mirror multiple images in Twitter posts #3

Open
kupiakos opened this issue Feb 17, 2016 · 3 comments
Open

Cannot mirror multiple images in Twitter posts #3

kupiakos opened this issue Feb 17, 2016 · 3 comments
Labels

Comments

@kupiakos
Copy link
Owner

Example

@kupiakos kupiakos changed the title Cannot multiple images in Twitter posts Cannot mirror multiple images in Twitter posts Feb 17, 2016
@kupiakos kupiakos added the bug label Mar 22, 2016
@spiral6
Copy link
Contributor

spiral6 commented Jan 24, 2017

I've got it: you have to iterate through status.extended_entities['media'] in twitter.py to get each media url, get the large size by the url + ":large" added to the end, and then return those urls.

Imgur does support and work with http://image.jpg:large.

@spiral6
Copy link
Contributor

spiral6 commented Jan 28, 2017

According to the logs:

Imported data from submission "https://twitter.com/arberlezi/status/674116679450951680"
DEBUG - Import info: [{'importer_display': {'header': 'Mirrored Twitter image from GumballFallsFan (@ArberLezi):\n\n'}, 'import_urls': ['http://pbs.twimg.com/media/CVrxiFgU4AAXrII.jpg:large', 'http://pbs.twimg.com/media/CVrxiFuUsAEFyj9.jpg:large'], 'author': 'the Twitter user GumballFallsFan (@ArberLezi)', 'source': 'https://twitter.com/arberlezi/status/674116679450951680'}]
DEBUG - Calling export_submission() on plugins
DEBUG - An album will be uploaded.
DEBUG - Uploading URL "http://pbs.twimg.com/media/CVrxiFgU4AAXrII.jpg:large" to imgur
DEBUG - Uploaded image: {'bandwidth': 0, 'vote': None, 'height': 288, 'section': None, 'animated': False, 'width': 645, 'datetime': 1485635891, 'id': 'CdiyV0I', 'nsfw': None, 'favorite': False, 'link': 'http://i.imgur.com/CdiyV0I.jpg', 'is_ad': False, 'deletehash': 'VlssIqdBlxZLYnw', 'size': 35568, 'type': 'image/jpeg', 'account_id': 0, 'views': 0, 'name': '', 'account_url': None, 'description': None, 'title': None, 'in_gallery': False}
DEBUG - Uploading URL "http://pbs.twimg.com/media/CVrxiFuUsAEFyj9.jpg:large" to imgur
DEBUG - Uploaded image: {'bandwidth': 0, 'vote': None, 'height': 640, 'section': None, 'animated': False, 'width': 960, 'datetime': 1485635893, 'id': 'HFSVrWX', 'nsfw': None, 'favorite': False, 'link': 'http://i.imgur.com/HFSVrWX.jpg', 'is_ad': False, 'deletehash': 'op4NmGQBTJAveuL', 'size': 62034, 'type': 'image/jpeg', 'account_id': 0, 'views': 0, 'name': '', 'account_url': None, 'description': None, 'title': None, 'in_gallery': False}
INFO - Successfully imported data from ImgurPlugin.export_submission()
INFO - Replied comment to https://www.reddit.com/r/heyitsshugatest/comments/5qpqsn/testing_to_see_if_large_images_are_mirrored_by/

The fix imports large images by default. So no need to concatanate/replace an extension for the URLs.

spiral6 added a commit to spiral6/LapisMirror that referenced this issue Jan 28, 2017
Fixes twitter multi-image post mirroring.
@spiral6
Copy link
Contributor

spiral6 commented Feb 9, 2017

This issue can be closed as soon as it's merged.

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