Commit Graph

30 Commits

Author SHA1 Message Date
decoy-walrus 644fe41a08 Use the correct format string for fetching files from twitter.
Per their docs https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/entities#photo_format
2022-02-08 14:50:56 -05:00
decoy-walrus 4cdb8f78cb Add new endpoint for original resolution images
This change is to work around the issue that chromium based browsers have handling the "name=orig" parameter appended to URLs. This parameter is needed to retrieve the full resolution image from twitter, but causes those browsers to fill in "jpg_name=orig" as the extension on the filename.

This change adds a new endpoint, "/pic/orig/<encoded media>". This new endpoint will internally fetch the URL with ":orig" appended on the end for the full res image. Externally, the endpoint will serve the image without the extra parameter to expose the real extension to the browser.

This new endpoint is used when rendering tweets with attached images. The old endpoint is still in place for all other proxied images, and for any legacy links.

I also updated the "?name=small" parameter to ":small" since that seems to be the new pattern for image sizing.

This should fix issue #458.
2022-02-07 16:21:20 -05:00
Zed 43b0bdc08a Remove user agents 2022-01-17 04:13:27 +01:00
Zed 73b5b60ac3 Add license headers
Closes #413
2021-12-27 02:37:38 +01:00
decoy-walrus 15e1ba1322
Hack in support for the new twitter video format (#381)
This change adds ".m4s" and ".mp4" to the regex that modifies m3u8 playlist files proxied from twitter, and adds ".m4s" to the list of extensions proxied through nitter. The net effect is the new video format that twitter is using now should be supported.
2021-05-08 18:05:31 +02:00
Zed 3107ab0ab8 Fix content-length crash 2020-11-07 23:02:27 +01:00
Zed db45433ec4 Optimize usage of cookie preferences 2020-06-09 16:45:21 +02:00
Zed 310c5e936d Optional base64 support for proxy urls 2020-06-09 15:22:58 +02:00
Zed 40ef23956a Catch connection closed errors 2020-06-07 08:23:05 +02:00
Zed 47c87f7068 Strip https://pbs.twimg.com from image urls 2020-06-07 07:55:57 +02:00
Zed 68a5ac20b6 Proxy media instead of using file cache 2020-06-06 04:39:22 +02:00
Zed 7acea6b9e0 Add user agent for media requests, improve error 2020-06-02 20:27:43 +02:00
Zed 80d963fab6 Fix crash when disk is full 2020-06-02 19:58:24 +02:00
Zed 4c928fa8b0 Routing updates 2020-06-02 18:05:54 +02:00
Zed 5eec0bde3d Misc. fixes and refactorings 2020-06-02 18:05:54 +02:00
Zed b03faccd45 Turn regex patterns into consts 2020-01-22 13:04:35 +01:00
Zed 0924ea033d Catch failed guest token exception 2020-01-10 18:20:16 +01:00
Zed ee43d8cfb1 Catch SSL shutdown errors when closing clients 2020-01-01 17:24:24 +01:00
Zed be15f1b001 Prevent 403 errors from outdated videos 2019-12-22 01:46:21 +01:00
Zed f9c4acabf8 Ignore params for gifs 2019-12-06 15:14:38 +01:00
Zed a56f217074 Fix exception when image path is empty 2019-10-24 00:04:54 +02:00
Zed ea4a8cab2f Fix white page on cached empty files 2019-10-21 07:59:36 +02:00
Zed a78eea9dce Fix 404 page 2019-10-21 07:59:22 +02:00
Zed cfcd471ffc Use sendFile, refactor mimetypes 2019-10-21 05:55:18 +02:00
Zed de62eedea5 Refactor hostname to be a runtime option
Add a `hostname` field under Server in your conf file, see the
updated nitter.conf in the repo for an example. The compile-time
option (-d:hostname) is no longer used.
2019-10-21 05:19:00 +02:00
Zed ebb89edef6 Use custom 404 page, halt on 404 instead of resp 2019-10-07 16:47:53 +02:00
Zed 9e3138e51b Add list support 2019-09-21 01:08:30 +02:00
Zed 7639883c6a Cleanup 2019-09-20 15:03:18 +02:00
Zed 9c91688497 Restrict image/gif media host instead of hashing 2019-09-13 12:27:04 +02:00
Zed 014f01bf88 Refactor routing code 2019-09-06 02:42:35 +02:00