#bridgy

(3)
GitHub github.com
Error if more than 4 images on Mastodon's Bridge · Issue #913 · snarfed/bridgy
Jee Jee
@GitHub

oh yeah it work, thank you.

#bridgy #image #mastodon
Jee Jee
@GitHub

Hi,

Is it possible to make Matodon’s bridge handle images if there is more than 4 images like twitter. Actually if the post have more than 4 images Bridgy return an error for mastodon but for twitter it takes the first four images without error.

Bridgy’s logs

Mastodon:

 2020-01-19 17:04:16.582465 requests.get https://media.jeer.fr/file-20200119171619-3883.jpg {}
I 2020-01-19 17:04:17.186737 requests.post https://mamot.fr/api/v1/media {'files': {'file': <urllib3.response.HTTPResponse object at 0x3e32e53ae5d0>}, 'headers': {'Authorization': '...'}}
I 2020-01-19 17:04:20.107750 Got: {'id': '7995088', 'type': 'image', 'url': 'https://mamot.fr/system/media_attachments/files/007/995/088/original/b458e086d8257c46.jpeg?1579453459', 'preview_url': 'https://mamot.fr/system/media_attachments/files/007/995/088/small/b458e086d8257c46.jpeg?1579453459', 'remote_url': None, 'text_url': 'https://mamot.fr/media/uLhoOpB15m61be0mCPc', 'meta': {'original': {'width': 1568, 'height': 1045, 'size': '1568x1045', 'aspect': 1.5004784688995212}, 'small': {'width': 490, 'height': 327, 'size': '490x327', 'aspect': 1.498470948012232}}, 'description': None, 'blurhash': 'UQFesB631v,@|eoe63sCwgWVSdoMxGNaslkC'}
I 2020-01-19 17:04:20.108866 requests.get https://media.jeer.fr/file-20200119171800-5064.jpg {}
I 2020-01-19 17:04:20.714576 requests.post https://mamot.fr/api/v1/media {'files': {'file': <urllib3.response.HTTPResponse object at 0x3e32e5b8e110>}, 'headers': {'Authorization': '...'}}
I 2020-01-19 17:04:23.835119 Got: {'id': '7995089', 'type': 'image', 'url': 'https://mamot.fr/system/media_attachments/files/007/995/089/original/01251f5617ab5605.jpeg?1579453462', 'preview_url': 'https://mamot.fr/system/media_attachments/files/007/995/089/small/01251f5617ab5605.jpeg?1579453462', 'remote_url': None, 'text_url': 'https://mamot.fr/media/F_8RtbJV1nnl7a_Ad0w', 'meta': {'original': {'width': 1569, 'height': 1044, 'size': '1569x1044', 'aspect': 1.50287356321839}, 'small': {'width': 490, 'height': 326, 'size': '490x326', 'aspect': 1.503067484662576}}, 'description': None, 'blurhash': 'UoKRBl0$%KE3K4R*kCjFNHxZr@SgsAW;WCs:'}
I 2020-01-19 17:04:23.836799 requests.get https://media.jeer.fr/file-20200119171842-8178.jpg {}
I 2020-01-19 17:04:24.979363 requests.post https://mamot.fr/api/v1/media {'files': {'file': <urllib3.response.HTTPResponse object at 0x3e32e572d090>}, 'headers': {'Authorization': '...'}}
I 2020-01-19 17:04:33.744118 Got: {'id': '7995092', 'type': 'image', 'url': 'https://mamot.fr/system/media_attachments/files/007/995/092/original/f61a0b9cda107374.jpeg?1579453472', 'preview_url': 'https://mamot.fr/system/media_attachments/files/007/995/092/small/f61a0b9cda107374.jpeg?1579453472', 'remote_url': None, 'text_url': 'https://mamot.fr/media/uNHhrT8azrL7X2j_o7U', 'meta': {'original': {'width': 1569, 'height': 1044, 'size': '1569x1044', 'aspect': 1.50287356321839}, 'small': {'width': 490, 'height': 326, 'size': '490x326', 'aspect': 1.503067484662576}}, 'description': None, 'blurhash': 'U23[Veaw0fIrxuWBWERl9uR--Ut2RpWCs+t6'}
I 2020-01-19 17:04:33.745460 requests.get https://media.jeer.fr/file-20200119172640-5394.jpg {}
I 2020-01-19 17:04:34.339769 requests.post https://mamot.fr/api/v1/media {'files': {'file': <urllib3.response.HTTPResponse object at 0x3e32e5342190>}, 'headers': {'Authorization': '...'}}
I 2020-01-19 17:04:42.635580 Got: {'id': '7995095', 'type': 'image', 'url': 'https://mamot.fr/system/media_attachments/files/007/995/095/original/99364353e1f942ed.jpeg?1579453481', 'preview_url': 'https://mamot.fr/system/media_attachments/files/007/995/095/small/99364353e1f942ed.jpeg?1579453481', 'remote_url': None, 'text_url': 'https://mamot.fr/media/saL3jQexjTX7bJNgCes', 'meta': {'original': {'width': 1569, 'height': 1044, 'size': '1569x1044', 'aspect': 1.50287356321839}, 'small': {'width': 490, 'height': 326, 'size': '490x326', 'aspect': 1.503067484662576}}, 'description': None, 'blurhash': 'UU5g+ab8NOjntDa@R:oGbJWTjboJbDfOj[oM'}
I 2020-01-19 17:04:42.635903 requests.get https://media.jeer.fr/file-20200119173405-1487.jpg {}
I 2020-01-19 17:04:43.236735 requests.post https://mamot.fr/api/v1/media {'files': {'file': <urllib3.response.HTTPResponse object at 0x3e32e53bf990>}, 'headers': {'Authorization': '...'}}
I 2020-01-19 17:04:49.154711 Got: {'id': '7995097', 'type': 'image', 'url': 'https://mamot.fr/system/media_attachments/files/007/995/097/original/ad22f020b3ba7fef.jpeg?1579453487', 'preview_url': 'https://mamot.fr/system/media_attachments/files/007/995/097/small/ad22f020b3ba7fef.jpeg?1579453487', 'remote_url': None, 'text_url': 'https://mamot.fr/media/sAB5vxiT9kPHzuG0UTk', 'meta': {'original': {'width': 1568, 'height': 1045, 'size': '1568x1045', 'aspect': 1.5004784688995212}, 'small': {'width': 490, 'height': 327, 'size': '490x327', 'aspect': 1.498470948012232}}, 'description': None, 'blurhash': 'UO9h=YJ0NHxaxMR}jKk7J2oNs=R%oNa^WUj['}
I 2020-01-19 17:04:49.156102 requests.post https://mamot.fr/api/v1/statuses {'json': {'status': 'Merci a @DirtyDeepBlues #thomasschoeffler #badjuice #domferrer #sixsix @RadioQuetsch pour cette soirée\n\n#thomasschoeffler #badjuice #domferrer #sixsix #blues #DirtyDeep #RadioQuetsch #Altkirch #HalleauBle (https://jeer.fr/micro/1579453431)', 'media_ids': ['7995088', '7995089', '7995092', '7995095', '7995097']}, 'headers': {'Authorization': '...'}}
E 2020-01-19 17:04:49.572736 Error 422, response body: '{"error":"Cannot attach more than 4 files"}'
E 2020-01-19 17:04:49.573037 Error 422, response body: '{"error":"Cannot attach more than 4 files"}'
I 2020-01-19 17:04:49.575979 Error: {"error":"Cannot attach more than 4 files"} 422 Client Error: Unprocessable Entity for url: https://mamot.fr/api/v1/statuses
Stack (most recent call last):
  File "/opt/python3.7/lib/python3.7/threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
  File "/opt/python3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/opt/python3.7/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/python3.7/lib/python3.7/concurrent/futures/thread.py", line 80, in _worker
    work_item.run()
  File "/opt/python3.7/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)

... blablabla

Twitter :

E 2020-01-19 17:04:05.048404 Found 5 photos! Only using the first 4: [{'url': 'https://media.jeer.fr/file-20200119171619-3883.jpg'}, {'url': 'https://media.jeer.fr/file-20200119171800-5064.jpg'}, {'url': 'https://media.jeer.fr/file-20200119171842-8178.jpg'}, {'url': 'https://media.jeer.fr/file-20200119172640-5394.jpg'}]
I 2020-01-19 17:04:05.048699 urlopen GET https://media.jeer.fr/file-20200119171619-3883.jpg {}
I 2020-01-19 17:04:05.761219 requests.post https://upload.twitter.com/1.1/media/upload.json {'files': {'media': <http.client.HTTPResponse object at 0x3e32e53b91d0>}, 'headers': {'Content-Length': '...', 'Authorization': '...'}}
I 2020-01-19 17:04:07.636169 Got: {"media_id":1218942220247732224,"media_id_string":"1218942220247732224","size":792215,"expires_after_secs":86400,"image":{"image_type":"image\/jpeg","w":1999,"h":1332}}
I 2020-01-19 17:04:07.637851 urlopen GET https://media.jeer.fr/file-20200119171800-5064.jpg {}
I 2020-01-19 17:04:08.228317 requests.post https://upload.twitter.com/1.1/media/upload.json {'files': {'media': <http.client.HTTPResponse object at 0x3e32e53b9c50>}, 'headers': {'Content-Length': '...', 'Authorization': '...'}}
I 2020-01-19 17:04:10.023777 Got: {"media_id":1218942230389542918,"media_id_string":"1218942230389542918","size":1292255,"expires_after_secs":86400,"image":{"image_type":"image\/jpeg","w":2000,"h":1331}}
I 2020-01-19 17:04:10.025410 urlopen GET https://media.jeer.fr/file-20200119171842-8178.jpg {}
I 2020-01-19 17:04:10.634453 requests.post https://upload.twitter.com/1.1/media/upload.json {'files': {'media': <http.client.HTTPResponse object at 0x3e32e5256fd0>}, 'headers': {'Content-Length': '...', 'Authorization': '...'}}
I 2020-01-19 17:04:12.236507 Got: {"media_id":1218942239918960646,"media_id_string":"1218942239918960646","size":867139,"expires_after_secs":86400,"image":{"image_type":"image\/jpeg","w":2000,"h":1331}}
I 2020-01-19 17:04:12.236857 urlopen GET https://media.jeer.fr/file-20200119172640-5394.jpg {}
I 2020-01-19 17:04:12.816252 requests.post https://upload.twitter.com/1.1/media/upload.json {'files': {'media': <http.client.HTTPResponse object at 0x3e32e53c6450>}, 'headers': {'Content-Length': '...', 'Authorization': '...'}}
I 2020-01-19 17:04:14.637009 Got: {"media_id":1218942249993633793,"media_id_string":"1218942249993633793","size":797232,"expires_after_secs":86400,"image":{"image_type":"image\/jpeg","w":2000,"h":1331}}
I 2020-01-19 17:04:14.641953 urlopen POST https://api.twitter.com/1.1/statuses/update.json?media_ids=1218942220247732224%2C1218942230389542918%2C1218942239918960646%2C1218942249993633793&status=Merci+a+%40DirtyDeepBlues+%23thomasschoeffler+%23badjuice+%23domferrer+%23sixsix+%40RadioQuetsch+pour+cette+soir%C3%A9e%0A%0A%23thomasschoeffler+%23badjuice+%23domferrer+%23sixsix+%23blues+%23DirtyDeep+%23RadioQuetsch+%23Altkirch+%23HalleauBle+%28https%3A%2F%2Fjeer.fr%2Fmicro%2F1579453431%29 {}
I 2020-01-19 17:04:15.190580 Returning {
... blablabla

Thank’s :*

#Bridgy #Mastodon #Twitter #Error #publish #image
Jee Jee

[Test] publish to mastodon and twitter via https://brid.gy

#test #twitter #mastodon #fediverse #syndication #bridgy