Commit Graph

65 Commits

Author SHA1 Message Date
Rongrong 3bafebf781
fix(parsing): WEBP unnecessarily converted to PNG
Since some time in 2022, Telegram DC will convert any WEBP sent as an
image to a JPG. Any manual conversion should be unnecessary.

Signed-off-by: Rongrong <i@rong.moe>
2022-11-13 23:46:33 +08:00
Rongrong e4a545932d
refactor(parsing/medium): remove redundant attr
Signed-off-by: Rongrong <i@rong.moe>
2022-11-13 23:46:32 +08:00
Rongrong f9fba772b2
feat(parsing/medium): detailed debug output
Signed-off-by: Rongrong <i@rong.moe>
2022-07-21 18:06:06 +08:00
Rongrong ae4fe04c07
feat(parsing/medium): detailed fallback reason
Signed-off-by: Rongrong <i@rong.moe>
2022-07-21 11:24:13 +08:00
Rongrong 95149ba1a6
feat(parsing/medium): get medium via relay server
Try relay server if failed to get medium info directly

Signed-off-by: Rongrong <i@rong.moe>
2022-05-21 04:49:54 +08:00
Rongrong a42e746747
perf(*): close all BytesIO immediately after used
Signed-off-by: Rongrong <i@rong.moe>
2022-05-21 04:22:15 +08:00
Rongrong caed5930e4
fix(parsing/medium): mistaken existence check
Signed-off-by: Rongrong <i@rong.moe>
2022-05-10 17:51:20 +08:00
Neko Aria 3c99aa9454
refactor(*): simplify condition, improve readability (#66) 2022-04-28 14:05:26 +08:00
Rongrong 041e4e01f6
feat(*): lazy media validation mode
Signed-off-by: Rongrong <i@rong.moe>
2022-04-28 11:51:44 +08:00
Rongrong 170bbb7686
fix(*): potential buggy media type judgement
Signed-off-by: Rongrong <i@rong.moe>
2022-04-28 11:51:14 +08:00
Rongrong ee5d37a39e
feat(*): network traffic saving mode
Signed-off-by: Rongrong <i@rong.moe>
2022-04-28 11:51:09 +08:00
Rongrong a0a682ed6f
feat(*): optimize sending timeout logic
Signed-off-by: Rongrong <i@rong.moe>
2022-04-23 23:26:57 +08:00
Rongrong 9297cb9cdb
feat(parsing/medium): detailed logging
Signed-off-by: Rongrong <i@rong.moe>
2022-04-23 22:41:15 +08:00
Neko Aria 3b3ee6679c
style(*): improve readability (#63) 2022-04-23 20:41:00 +08:00
Rongrong c88549a768
feat(*): optimize lock acquisition timeout logic
Signed-off-by: Rongrong <i@rong.moe>
2022-04-22 10:52:31 +08:00
Rongrong 402b43fc65
feat(*): cancel if lock acquisition timed out
Signed-off-by: Rongrong <i@rong.moe>
2022-04-22 03:29:19 +08:00
Neko Aria 98cfd13156
style(*): improve readability (#62) 2022-04-22 02:07:27 +08:00
Neko Aria 153406ecf0
refactor(*): simplify some logic and remove unnecessary f-string (#61) 2022-04-21 03:36:26 +08:00
Rongrong 479ae86d71
Revert "feat(web): speedup, bandwidth usage cut down"
This reverts commit 67956fbbbe.
2022-04-15 01:59:46 +08:00
Rongrong f0e71b0d0f
feat(parsing): steadier enclosure dedup
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-04-13 12:26:51 +08:00
Rongrong 67956fbbbe
feat(web): speedup, bandwidth usage cut down
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-04-10 16:48:51 +08:00
Rongrong bc28e909c4
refactor(*): migrate to `typing_extensions.Final`
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-04-01 05:44:15 +08:00
Rongrong 91fe75ea90
style(*): code cleaning
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-04-01 05:39:08 +08:00
Rongrong e2e60328b2
chore(*): make `src` become a module
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-30 15:21:29 +08:00
Rongrong 0fe0abbe15
style(*): minor cleaning
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-29 05:11:46 +08:00
Rongrong e838987b2f
feat(parsing): draw image for multi-column table
experimental, currently only for Telegram messages

Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-21 23:30:29 +08:00
Rongrong aaea0d628b
fix(web): loose Exif thumbnail exit judgement
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-14 20:31:04 +08:00
Rongrong ae5e3ca31e
feat(parsing/medium): enforce dimension detection
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-14 16:22:04 +08:00
Rongrong 9291237036
fix(parsing): non-HTTP URL not wrapped in code
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-14 09:58:01 +08:00
Rongrong ede3b5c5eb
fix(parsing): non-HTTP URL (especially magnet)
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-13 17:14:35 +08:00
Rongrong 07d5dab346
feat(parsing): telegraph anti-anti-hotlinking
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-12 00:56:28 +08:00
Rongrong c1e3cfc1a9
fix(parsing/command): unnecessary image fallback
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-11 15:11:29 +08:00
Rongrong 3026ef698c
fix(parsing/medium): some icon not dropped
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-11 08:15:03 +08:00
Rongrong 018c335177
feat(parsing/medium): add audio fallback for lizhi.fm
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-10 08:00:41 +08:00
Rongrong 6be7e34fad
fix(parsing): `display_media`
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-08 13:32:39 +08:00
Rongrong a2cdb0d0cd
fix(parsing/medium): long pic judge
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-08 06:49:09 +08:00
Rongrong fccdb6db04
feat(parsing): drop more icons
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-08 04:45:06 +08:00
Rongrong 1e2d68decc
feat(parsing/medium): enhance image info get
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-08 03:42:15 +08:00
Rongrong 9621bb8010
fix(parsing/medium): `Content-Type` None check
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-06 17:01:25 +08:00
Rongrong 50759dfe87
feat(parsing/medium): more fallback
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-06 02:22:23 +08:00
Rongrong 50159d86b7
fix(parsing/medium): uploading concurrency unlimited
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-05 07:07:03 +08:00
Rongrong 19d2685c23
feat(parsing/medium): SVG/WebP/non-weibo pic fallback
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>

#45
2022-03-04 14:01:32 +08:00
Rongrong 7d17901e94
feat(parsing): drop base64 icons, SVGs and tables
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-03 07:02:24 +08:00
Rongrong 5ae3cc4d75
feat(parsing): enclosure and HTML <audio> support
enjoy listening to podcasts!

Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-03 05:51:13 +08:00
Rongrong b1b976ae46
feat(parsing/medium): flood and internal error retry
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-02 23:37:23 +08:00
Rongrong 965ebecff5
feat(parsing/medium): long pic fallback to file
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-02 19:14:39 +08:00
Rongrong c1f7e99504
feat(parsing/medium): fallback [video->]image->file
introduce new dep asyncstdlib==3.10.3

Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-02 15:26:49 +08:00
Rongrong 7e698d0a5f
feat(parsing): customizable post format
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-03-01 04:06:28 +08:00
Rongrong 58bb2655b9
fix(parsing): media fallback race condition
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-02-25 00:33:49 +08:00
Rongrong 4c5eb78d98
refactor(parsing): media type fallback, (Animation fallback to Image support)
Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
2022-02-23 17:27:14 +08:00