y-young / nazurin Goto Github PK
View Code? Open in Web Editor NEW🎉 Images collection done right. Telegram 图片收藏机器人 / A Telegram bot that helps you collect ACG illustrations.
Home Page: http://nazurin.readthedocs.io
License: MIT License
🎉 Images collection done right. Telegram 图片收藏机器人 / A Telegram bot that helps you collect ACG illustrations.
Home Page: http://nazurin.readthedocs.io
License: MIT License
Describe the bug
A clear and concise description of what the bug is.
Duplicate folders are created in Google Drive when using GoogleDrive as Storage
To Reproduce
Steps to reproduce the behavior:
Done
Environment (please complete the following information):
Describe the bug
Onedrive作为存储,成功创建了文件夹,但是报错无法上传文件,telegram bot回复“Response Error: 400 Bad Request“
2023-06-07 10:13:21,291-0400 - INFO - nazurin.middleware:25 - update:658614568 - Message 490: https://twitter.com/pieleaf_x2/status/1656239069461102592?s=46&t=sRguD45342wIFRmICSHhQw
2023-06-07 10:13:21,294-0400 - INFO - nazurin.bot:123 - update:658614568 - Collection update: site=twitter, match=('1656239069461102592',)
2023-06-07 10:13:21,306-0400 - INFO - nazurin.sites.twitter.api.web:114 - update:658614568 - Fetching tweet 1656239069461102592 from web API
2023-06-07 10:13:21,318-0400 - INFO - aiohttp.web_log:206 - - 127.0.0.1 "POST /923219210:AJSMNNWJDSzsdsaAOOQOPWEnkajsd HTTP/1.0" 200 152 "-" "-"
2023-06-07 10:13:23,163-0400 - INFO - nazurin.storage.onedrive:66 - update:658614568 - Creating folders: {PosixPath('Nazurin/Twitter')}
2023-06-07 10:13:23,167-0400 - INFO - nazurin.storage.onedrive:37 - update:658614568 - Creating drive item...
2023-06-07 10:13:24,063-0400 - ERROR - nazurin.storage.onedrive:192 - update:658614568 - {"error":{"code":"invalidRequest","message":"Cannot create a file without content","innerError":{"date":"2023-06-07T14:11:07","request-id":"3ac0xxxxxx","client-request-id":"3ac02xxxxxx"}}}
Traceback (most recent call last):
File "/root/nazurin/nazurin/__main__.py", line 91, in on_error
raise exception
File "/usr/local/lib/python3.9/dist-packages/aiogram/dispatcher/dispatcher.py", line 1394, in process_response
response = task.result()
File "/root/nazurin/nazurin/dispatcher.py", line 119, in update_collection
await self.bot.update_collection(urls, message)
File "/root/nazurin/nazurin/bot.py", line 157, in update_collection
await self.storage.store(illust)
File "/root/nazurin/nazurin/storage/__init__.py", line 26, in store
await asyncio.gather(*tasks)
File "/root/nazurin/nazurin/storage/onedrive.py", line 70, in store
await asyncio.gather(*tasks)
File "/root/nazurin/nazurin/storage/onedrive.py", line 49, in upload
response = await self._request("POST", create_file_url, json=body)
File "/usr/local/lib/python3.9/dist-packages/tenacity/_asyncio.py", line 48, in call
do = self.iter(retry_state=retry_state)
File "/usr/local/lib/python3.9/dist-packages/tenacity/__init__.py", line 320, in iter
return fut.result()
File "/usr/lib/python3.9/concurrent/futures/_base.py", line 433, in result
return self.__get_result()
File "/usr/lib/python3.9/concurrent/futures/_base.py", line 389, in __get_result
raise self._exception
File "/usr/local/lib/python3.9/dist-packages/tenacity/_asyncio.py", line 51, in call
result = yield from fn(*args, **kwargs)
File "/root/nazurin/nazurin/storage/onedrive.py", line 193, in _request
response.raise_for_status()
File "/usr/local/lib/python3.9/dist-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://graph.microsoft.com/v1.0/me/drive/items/root:/Nazurin/Twitter:/children')
Expected behavior
A clear and concise description of what you expected to happen.
正常上传图片,然而只是创建了文件夹
Environment (please complete the following information):
Linux debian 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02) x86_64 GNU/Linux
Python 3.9.2
Additional context
同时如果我更换了onedrive的client ID和secret,数据库并不会自己更新,一直会尝试用旧的....手动去删除了数据库中的onedrive才能使用本地.env中的新client ID和secret
Describe the bug
Pixiv animation cannot be converted after beta.4 version, The beta.3 version is convertible
To Reproduce
Steps to reproduce the behavior:
Error output / Logs
2021-11-11T14:35:44.038944+00:00 app[web.1]: 2021-11-11 14:35:44,038 - nazurin - INFO - Collection update: site=Pixiv, match=('90093791',)
2021-11-11T14:35:44.049723+00:00 heroku[router]: at=info ......
2021-11-11T14:35:44.050392+00:00 app[web.1]: 2021-11-11 14:35:44,050 - aiohttp.access ......
2021-11-11T14:35:45.049413+00:00 app[web.1]: 2021-11-11 14:35:45,049 - nazurin - INFO - Bookmarked artwork 90093791
2021-11-11T14:35:48.983099+00:00 app[web.1]: 2021-11-11 14:35:48,982 - nazurin - INFO - Calling FFmpeg with command: ffmpeg -i data/temp/90093791_ugoira1920x1080.ffconcat -vcodec libx264 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -y data/temp/90093791_ugoira1920x1080.mp4
2021-11-11T14:35:49.043231+00:00 app[web.1]: 2021-11-11 14:35:49,042 - nazurin - ERROR - FFmpeg failed with code 1, output:
2021-11-11T14:35:49.043234+00:00 app[web.1]: b'ffmpeg version N-59498-g45dc668aea-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2021 the FFmpeg developers\n built with gcc 8 (Debian 8.3.0-6)\n configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg\n libavutil 57. 7.100 / 57. 7.100\n libavcodec 59. 12.100 / 59. 12.100\n libavformat 59. 8.100 / 59. 8.100\n libavdevice 59. 0.101 / 59. 0.101\n libavfilter 8. 16.101 / 8. 16.101\n libswscale 6. 1.100 / 6. 1.100\n libswresample 4. 0.100 / 4. 0.100\n libpostproc 56. 0.100 / 56. 0.100\n[concat @ 0x6e82f00] Line 3: duration not allowed if safe\ndata/temp/90093791_ugoira1920x1080.ffconcat: Invalid data found when processing input\n'
Environment (please complete the following information):
Work at Team Drive
希望提供一个 /pixiv_bookmark_private
指令,用于非公开收藏 pixiv 插画。
希望能同时提供默认进行非公开收藏的选项。开启后,不带任何指令发送链接时默认使用 /pixiv_bookmark_private
。
e.g. 变量 BOOKMARK_PUBLICITY
默认 public
可以设置为 private
,或者 bot 指令切换、用 Firebase 记录状态。
谢谢。
Describe the bug
列:https://t.me/NazurinDemoTestChannel/1107
使用默认 ffmpeg -i "{config.path}" -vcodec libx264 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -y "{output.path}"
参数转换
在安卓设备(安卓8 & 10)里无法播放,显示为白屏
在IOS、PC端和Web端(& Web在线url预览)里正常
To Reproduce
Steps to reproduce the behavior:
Expected behavior
我直接用另外一个同类项目 my-telegram-bots/Pixiv_bot 里 https://github.com/my-telegram-bots/Pixiv_bot/blob/50a14ce58bdb12b125c8668cf78e988b714601d3/handlers/pixiv/tools.js#L162 的 ffmpeg 参数更改来使用
ffmpeg -i "{config.path}" -vcodec libx264 -vf "format=yuv420p,scale=trunc(iw/2)*2:trunc(ih/2)*2" -y "{output.path}"
结果:https://t.me/NazurinDemoTestChannel/1110
测试结果:安卓、IOS、PC端和Web端均正常显示
此外该项目还额外使用 mp4fpsmod 添加 fps metadata ,而我还没添加过,可能是这个问题
Error output / Logs
无
Environment (please complete the following information):
Additional context
无
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
KeyError: 0
links tested (NSFW)
https://gelbooru.com/index.php?page=post&s=view&id=6707612
https://gelbooru.com/index.php?page=post&s=view&id=6322852
Expected behavior
collect the collection or show a clear error message
Error output / Logs
Logs are usually critical to identify the cause of a bug, please paste the complete log from start to end.
Make sure to remove or mask all secrets, such as bot token and personal information!
2022-03-07T11:58:39.707878+00:00 heroku[router]: at=info method=POST path="/SOME_BOT_TOKEN" host=misakah.herokuapp.com request_id=4f0ebd2e-e88c-45f5-8184-7495b85ab2ee fwd="91.108.6.78" dyno=web.1 connect=1ms service=9ms status=200 bytes=171 protocol=https
2022-03-07T11:58:39.700272+00:00 app[web.1]: 2022-03-07 11:58:39,700 - nazurin - INFO - Collection update: site=Gelbooru, match=('6707612',)
2022-03-07T11:58:39.708133+00:00 app[web.1]: 2022-03-07 11:58:39,707 - aiohttp.access - INFO - 10.1.23.249 [07/Mar/2022:11:58:39 +0000] "POST /SOME_BOT_TOKEN HTTP/1.1" 200 171 "-" "-"
2022-03-07T11:58:39.825972+00:00 app[web.1]: 2022-03-07 11:58:39,825 - nazurin - ERROR - Update {"update_id": 90486771, "message": {"message_id": 1505, "from": {"id": 673435039, "is_bot": false, "first_name": "欠陥電気", "last_name": "𝑹𝒂𝒅𝒊𝒐𝑵𝒐𝒊𝒔𝒆", "username": "Misaka_0x34ca", "language_code": "ja"}, "chat": {"id": 673435039, "first_name": "欠陥電気", "last_name": "𝑹𝒂𝒅𝒊𝒐𝑵𝒐𝒊𝒔𝒆", "username": "Misaka_0x34ca", "type": "private"}, "date": 1646654319, "text": "https://gelbooru.com/index.php?page=post&s=view&id=6707612", "entities": [{"type": "url", "offset": 0, "length": 58}]}} caused <class 'KeyError'>: 0
2022-03-07T11:58:39.826994+00:00 app[web.1]: Traceback (most recent call last):
2022-03-07T11:58:39.827084+00:00 app[web.1]: File "/app/nazurin/__main__.py", line 54, in on_error
2022-03-07T11:58:39.827085+00:00 app[web.1]: raise exception
2022-03-07T11:58:39.827125+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/dispatcher/dispatcher.py", line 1394, in process_response
2022-03-07T11:58:39.827125+00:00 app[web.1]: response = task.result()
2022-03-07T11:58:39.827142+00:00 app[web.1]: File "/app/nazurin/dispatcher.py", line 59, in update_collection
2022-03-07T11:58:39.827142+00:00 app[web.1]: await self.bot.updateCollection(urls, message)
2022-03-07T11:58:39.827167+00:00 app[web.1]: File "/app/nazurin/bot.py", line 112, in updateCollection
2022-03-07T11:58:39.827168+00:00 app[web.1]: illust = await self.sites.handle_update(result)
2022-03-07T11:58:39.827189+00:00 app[web.1]: File "/app/nazurin/sites/__init__.py", line 66, in handle_update
2022-03-07T11:58:39.827189+00:00 app[web.1]: return await handle(result['match'])
2022-03-07T11:58:39.827205+00:00 app[web.1]: File "/app/nazurin/sites/Gelbooru/interface.py", line 19, in handle
2022-03-07T11:58:39.827205+00:00 app[web.1]: illust = await Gelbooru().fetch(post_id)
2022-03-07T11:58:39.827221+00:00 app[web.1]: File "/app/nazurin/sites/Gelbooru/api.py", line 22, in fetch
2022-03-07T11:58:39.827222+00:00 app[web.1]: post = await self.getPost(post_id)
2022-03-07T11:58:39.827237+00:00 app[web.1]: File "/app/nazurin/sites/Gelbooru/api.py", line 18, in getPost
2022-03-07T11:58:39.827248+00:00 app[web.1]: post = response[0]
2022-03-07T11:58:39.827282+00:00 app[web.1]: KeyError: 0
2022-03-07T11:59:10.277016+00:00 heroku[router]: at=info method=POST path="/SOME_BOT_TOKEN" host=misakah.herokuapp.com request_id=c292ca3d-18bc-4d71-9ad6-a1cb8fe88559 fwd="91.108.6.78" dyno=web.1 connect=0ms service=13ms status=200 bytes=171 protocol=https
2022-03-07T11:59:10.266812+00:00 app[web.1]: 2022-03-07 11:59:10,266 - nazurin - INFO - Collection update: site=Gelbooru, match=('6322852',)
2022-03-07T11:59:10.277338+00:00 app[web.1]: 2022-03-07 11:59:10,277 - aiohttp.access - INFO - 10.1.23.249 [07/Mar/2022:11:59:10 +0000] "POST /SOME_BOT_TOKEN HTTP/1.1" 200 171 "-" "-"
2022-03-07T11:59:10.406410+00:00 app[web.1]: 2022-03-07 11:59:10,406 - nazurin - ERROR - Update {"update_id": 90486772, "message": {"message_id": 1507, "from": {"id": 673435039, "is_bot": false, "first_name": "欠陥電気", "last_name": "𝑹𝒂𝒅𝒊𝒐𝑵𝒐𝒊𝒔𝒆", "username": "Misaka_0x34ca", "language_code": "ja"}, "chat": {"id": 673435039, "first_name": "欠陥電気", "last_name": "𝑹𝒂𝒅𝒊𝒐𝑵𝒐𝒊𝒔𝒆", "username": "Misaka_0x34ca", "type": "private"}, "date": 1646654350, "text": "https://gelbooru.com/index.php?page=post&s=view&id=6322852", "entities": [{"type": "url", "offset": 0, "length": 58}]}} caused <class 'KeyError'>: 0
2022-03-07T11:59:10.406540+00:00 app[web.1]: Traceback (most recent call last):
2022-03-07T11:59:10.406573+00:00 app[web.1]: File "/app/nazurin/__main__.py", line 54, in on_error
2022-03-07T11:59:10.406573+00:00 app[web.1]: raise exception
2022-03-07T11:59:10.406576+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/dispatcher/dispatcher.py", line 1394, in process_response
2022-03-07T11:59:10.406576+00:00 app[web.1]: response = task.result()
2022-03-07T11:59:10.406586+00:00 app[web.1]: File "/app/nazurin/dispatcher.py", line 59, in update_collection
2022-03-07T11:59:10.406586+00:00 app[web.1]: await self.bot.updateCollection(urls, message)
2022-03-07T11:59:10.406594+00:00 app[web.1]: File "/app/nazurin/bot.py", line 112, in updateCollection
2022-03-07T11:59:10.406594+00:00 app[web.1]: illust = await self.sites.handle_update(result)
2022-03-07T11:59:10.406602+00:00 app[web.1]: File "/app/nazurin/sites/__init__.py", line 66, in handle_update
2022-03-07T11:59:10.406603+00:00 app[web.1]: return await handle(result['match'])
2022-03-07T11:59:10.406610+00:00 app[web.1]: File "/app/nazurin/sites/Gelbooru/interface.py", line 19, in handle
2022-03-07T11:59:10.406611+00:00 app[web.1]: illust = await Gelbooru().fetch(post_id)
2022-03-07T11:59:10.406619+00:00 app[web.1]: File "/app/nazurin/sites/Gelbooru/api.py", line 22, in fetch
2022-03-07T11:59:10.406619+00:00 app[web.1]: post = await self.getPost(post_id)
2022-03-07T11:59:10.406627+00:00 app[web.1]: File "/app/nazurin/sites/Gelbooru/api.py", line 18, in getPost
2022-03-07T11:59:10.406628+00:00 app[web.1]: post = response[0]
2022-03-07T11:59:10.406644+00:00 app[web.1]: KeyError: 0
Environment (please complete the following information):
Additional context
This function was working fine before.
The link opens fine manually. (even works while using Heroku's IP)
希望在储存文件夹里面再通过图片的来源分在不同文件夹里面,这样能稍微方便一点找图
-problem
"Also note that your bot will not be able to send more than 20 messages per minute to the same group."
https://core.telegram.org/bots/faq#my-bot-is-hitting-limits-how-do-i-avoid-this
Due to official restrictions, TG-Bot limits 20 messages per minute in groups/channels (and multiple pictures count as more information)
So when the limit is reached, there will be a failure to publish
2020-11-20T22:22:20.886923+00:00 app[web.1]: 2020-11-20 22:22:20,886-bot-INFO-BadRequest exception: Group send failed
So I recommend using userbot/pyrogram instead of TG-Bot
Or add delayed release / failed retransmission
We've heard that Pixiv no longer support logging in through username & password (upbit/pixivpy#158), but this change won't bring large effects to this project as for now.
In detail, if you had successfully used Pixiv functions, Nazurin will cache your access_token
& refresh_token
in database, which can be used to log in even without username & password.
In short, please keep your refresh_token
safely and there's nothing to worry about.
If you encountered any related problems, please leave a comment below.
我们已经了解到 Pixiv API 不再允许通过用户名和密码登录(upbit/pixivpy#158),但目前来看此变更不会对本项目造成太大影响
具体来说,如果曾经成功使用过 Pixiv 相关功能,Nazurin 将在数据库中缓存 access_token
和 refresh_token
,这两种凭据可单独用于登录而无需用户名和密码
因此只需 妥善保管好数据库中的 refresh_token
即可
如遇到相关问题,请在此 Issue 内留言
Describe the bug
No message reply after sending the /start
command.
Other functions seem to work properly.
To Reproduce
Steps to reproduce the behavior:
/start
to the botExpected behavior
The bot will reply Hi!
before.
Environment (please complete the following information):
Additional context
The following is the log of the bot:
2021-05-26T13:45:55.542282+00:00 heroku[router]: at=info method=POST path="/1301281176:AAE13v1BWU9QfqQzQItUHHG0jCDsflUWLS0" host=misakapicbot.herokuapp.com request_id=fa275fb5-ddaa-431d-a795-c8a1993a0d74 fwd="91.108.6.58" dyno=web.1 connect=1ms service=46ms status=200 bytes=177 protocol=https
2021-05-26T13:45:56.113117+00:00 app[web.1]: 2021-05-26 13:45:56,111 - nazurin - ERROR - Update {"update_id": 803739853, "message": {"message_id": 5928, "from": {"id": 673435039, "is_bot": false, "first_name": "欠陥電気", "last_name": "𝑹𝒂𝒅𝒊𝒐𝑵𝒐𝒊𝒔𝒆", "username": "Misaka_0x34ca", "language_code": "ja"}, "chat": {"id": 673435039, "first_name": "欠陥電気", "last_name": "𝑹𝒂𝒅𝒊𝒐𝑵𝒐𝒊𝒔𝒆", "username": "Misaka_0x34ca", "type": "private"}, "date": 1622036755, "text": "/start", "entities": [{"type": "bot_command", "offset": 0, "length": 6}]}} caused <class 'aiogram.utils.exceptions.CantParseEntities'>: Can't parse entities: unsupported start tag "id" at byte offset 121
2021-05-26T13:45:56.116012+00:00 app[web.1]: Traceback (most recent call last):
2021-05-26T13:45:56.117958+00:00 app[web.1]: File "/app/nazurin/__main__.py", line 53, in on_error
2021-05-26T13:45:56.117960+00:00 app[web.1]: raise exception
2021-05-26T13:45:56.117991+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/dispatcher/dispatcher.py", line 1340, in process_response
2021-05-26T13:45:56.117991+00:00 app[web.1]: response = task.result()
2021-05-26T13:45:56.120735+00:00 app[web.1]: File "/app/nazurin/utils/decorators.py", line 28, in wrapped_func
2021-05-26T13:45:56.120736+00:00 app[web.1]: result = await asyncio.create_task(func(message, *args, **kwargs))
2021-05-26T13:45:56.138391+00:00 app[web.1]: File "/app/nazurin/__main__.py", line 17, in show_help
2021-05-26T13:45:56.138393+00:00 app[web.1]: await message.reply('''
2021-05-26T13:45:56.145935+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/types/message.py", line 1500, in reply
2021-05-26T13:45:56.145938+00:00 app[web.1]: return await self.bot.send_message(
2021-05-26T13:45:56.145999+00:00 app[web.1]: File "/app/nazurin/utils/decorators.py", line 51, in decorator
2021-05-26T13:45:56.146000+00:00 app[web.1]: result = await func(*args, **kwargs)
2021-05-26T13:45:56.146456+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/bot/bot.py", line 314, in send_message
2021-05-26T13:45:56.146457+00:00 app[web.1]: result = await self.request(api.Methods.SEND_MESSAGE, payload)
2021-05-26T13:45:56.146506+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/bot/base.py", line 208, in request
2021-05-26T13:45:56.146507+00:00 app[web.1]: return await api.make_request(self.session, self.server, self.__token, method, data, files,
2021-05-26T13:45:56.146540+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/bot/api.py", line 140, in make_request
2021-05-26T13:45:56.146541+00:00 app[web.1]: return check_result(method, response.content_type, response.status, await response.text())
2021-05-26T13:45:56.146570+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/bot/api.py", line 115, in check_result
2021-05-26T13:45:56.146571+00:00 app[web.1]: exceptions.BadRequest.detect(description)
2021-05-26T13:45:56.146599+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/utils/exceptions.py", line 140, in detect
2021-05-26T13:45:56.146600+00:00 app[web.1]: raise err(cls.text or description)
2021-05-26T13:45:56.146705+00:00 app[web.1]: aiogram.utils.exceptions.CantParseEntities: Can't parse entities: unsupported start tag "id" at byte offset 121
部署四次,均为失败状态、
-Wrong example command
/pixiv 85721572
/pixiv 85723616
/pixiv 85722844
-Error logs
2020-11-20T02:45:08.235568+00:00 app[web.1]: 2020-11-17 02:45:08,235-bot-INFO-BadRequest exception: Failed to get http url content
-Preliminary judgment
It may be that a random value is added to the image URL, which makes it impossible to detect the Content-Length value of the PIXIV_MIRROR (i.pximg.net) image, so the thumbnail publishing cannot be switched normally
-Suggest
Detect the picture URL in the picture Content-Length value to remove the random value, and add the random value when sending the picture
系统日志:
2022-03-08T05:30:44.584080+00:00 heroku[router]: at=info method=POST path="/5280403552:xxxxxxxxxpryTwLeGfHrBQ0wO9OW8/5280403552:xxxxxxxxxpryTwLeGfHrBQ0wO9OW8" host=[myapp].herokuapp.com request_id=92f0a7da-0425-4627-815e-416160f588bd fwd="91.108.6.105" dyno=web.1 connect=0ms service=1ms status=404 bytes=191 protocol=https
2022-03-08T05:30:44.674988+00:00 heroku[router]: at=info method=POST path="/5280403552:xxxxxxxxxpryTwLeGfHrBQ0wO9OW8/5280403552:xxxxxxxxxpryTwLeGfHrBQ0wO9OW8" host=[myapp].herokuapp.com request_id=12e4a217-f8b2-45f2-939c-10f7df5d3ac6 fwd="91.108.6.105" dyno=web.1 connect=0ms service=1ms status=404 bytes=191 protocol=https
2022-03-08T05:30:44.584107+00:00 app[web.1]: 2022-03-08 05:30:44,583 - aiohttp.access - INFO - 10.1.57.139 [08/Mar/2022:05:30:44 +0000] "POST /5280403552:xxxxxxxxxpryTwLeGfHrBQ0wO9OW8/5280403552:xxxxxxxxxpryTwLeGfHrBQ0wO9OW8 HTTP/1.1" 404 191 "-" "-"
2022-03-08T05:30:44.674929+00:00 app[web.1]: 2022-03-08 05:30:44,674 - aiohttp.access - INFO - 10.1.57.139 [08/Mar/2022:05:30:44 +0000] "POST /5280403552:xxxxxxxxxpryTwLeGfHrBQ0wO9OW8/5280403552:xxxxxxxxxpryTwLeGfHrBQ0wO9OW8 HTTP/1.1" 404 191 "-" "-"
2022-03-08T05:30:44.770457+00:00 app[web.1]: 2022-03-08 05:30:44,770 - aiohttp.access - INFO - 10.1.57.139 [08/Mar/2022:05:30:44 +0000] "POST /5280403552:xxxxxxxxxpryTwLeGfHrBQ0wO9OW8/5280403552:xxxxxxxxxpryTwLeGfHrBQ0wO9OW8 HTTP/1.1" 404 191 "-" "-"
2022-03-08T05:30:44.770462+00:00 heroku[router]: at=info method=POST path="/5280403552:xxxxxxxxxpryTwLeGfHrBQ0wO9OW8/5280403552:xxxxxxxxxpryTwLeGfHrBQ0wO9OW8" host=[myapp].herokuapp.com request_id=653bdbf8-7df2-4b1b-8c87-1a738f8acb28 fwd="91.108.6.105" dyno=web.1 connect=0ms service=4ms status=404 bytes=191 protocol=https
问题不需要触发,一直存在。
已经设置ifttt的id为 allow_id,但是对ifttt发在群组里的链接没反应。对我自己发的链接能够正常触发。
设定是只对群组内非机器人用户的链接识别,还是一个bug或技术性难题?
如果能够识别其他机器人的链接,收藏图片就能全自动了。
https://blog.heroku.com/next-chapter
Can this project move to other platforms like vercel?
deviantart.com 和子站 sta.sh 。
涉及到的域名包括
www.deviantart.com
如 https://www.deviantart.com/exitmothership/art/Unfold-879580475 。[username].deviantart.com
如 https://exitmothership.deviantart.com/art/Unfold-879580475 ,改版前默认的链接格式,等价于上一条的表示方法。sta.sh
如 https://sta.sh/07zzvbquxv8 。fav.me
短链接,会重定向到 deviantart.com
。GitHub 上有 DeviantArt 下载的轮子,DeviantArt 自己也提供了 API 接口,这里还是提几个坑点:
art
表示画作,有且只有一张图片; journal
表示文章,可能是富文本,可能包含多张图片或者只是纯文字的文章。可以考虑暂不支持 journel
减轻工作量。sta.sh
存储的内容比较庞杂,有上面例子那样的图片,也有文件,如 https://sta.sh/016d5lui33bf 。谢谢。
Previously we had encountered strange BadRequest
exception when sending photos, but had no idea about the reason.
Recently Telegram has clarified some extra limitations on sending photos, which is not documented before:
The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. (https://core.telegram.org/bots/api#sendphoto)
While we can get file size through a simple HEAD
request, we'll need more information to determine the width & height of an image if we haven't got it from API, therefore it'll be more time-consuming.
Options we have (FYI):
Any idea is welcome, please comment below.
嘗試了很多次,都是失敗,之前是寫unsupported port:27017 [Error:111],現在是寫unsupported start tag "topologydescription" at byte offset 92acgimage-logs-1621602554456.txt
Describe the bug
A clear and concise description of what the bug is.
When I use nazurin, I send a pixiv link to the bot but I don't get a reply, it's the same after many attempts.
After I checked the log, I finally realized that these requests were blocked by pixiv.
To Reproduce
Steps to reproduce the behavior:
https://www.pixiv.net/artworks/96974628
)Expected behavior
A clear and concise description of what you expected to happen.
Output something to the user. Currently, the bot will not send the raw message because it is too long.
Error output / Logs
Logs are usually critical to identify the cause of a bug, please paste the complete log from start to end.
Make sure to remove or mask all secrets, such as bot token and personal information!
It's really long 🤣 See the log here
Environment (please complete the following information):
latest version deployed on heroku
Additional context
Add any other context about the problem here.
It worked fine before.
I have two nazurin deployed on heroku, they use the same pixiv account, one request is blocked while the other works fine at the same time. So maybe this will be a little hard to reproduce the problem (might need MITM 🤔)
Maybe this can be achieved by the http status code of the response?
Describe the bug
A clear and concise description of what the bug is.
png
s are created in data/temp
but have size 0
To Reproduce
Steps to reproduce the behavior:
https://www.pixiv.net/artworks/104233490
Error: Timeout, please try again.
Expected behavior
Fetch the images and send them to storages.
Error output / Logs
2023-01-06 15:13:11,215 - nazurin.__init__ - INFO - Loaded 12 sites
2023-01-06 15:13:12,492 - nazurin.__init__ - INFO - Loaded 2 storage(s), using: ['Telegram', 'GoogleDrive']
2023-01-06 15:13:12,498 - nazurin.dispatcher - INFO - Set webhook
2023-01-06 15:13:13,311 - aiogram.executor - INFO - Bot: ナズーリン [@botname]
======== Running on http://0.0.0.0:80 ========
(Press CTRL+C to quit)
2023-01-07 05:47:37,261 - nazurin.bot - INFO - Collection update: site=pixiv, match=('104233490',)
2023-01-07 05:47:37,373 - aiohttp.access.web_log - INFO - 172.18.0.1 [07/Jan/2023:05:47:37 +0000] "POST /<TELEGRAM_BOT_TOKEN> HTTP/1.0" 200 152 "-" "-"
2023-01-07 05:47:37,656 - nazurin.api - INFO - Bookmarked artwork 104233490, privacy = public
2023-01-07 05:47:40,815 - nazurin.image - INFO - Got image size: 2150086
2023-01-07 05:47:48,990 - tenacity.decorators - INFO - TimeoutError() during nazurin.models.file.File.download execution, 1 of 5 attempted.
2023-01-07 05:48:00,993 - tenacity.decorators - INFO - TimeoutError() during nazurin.models.file.File.download execution, 2 of 5 attempted.
2023-01-07 05:48:13,989 - tenacity.decorators - INFO - TimeoutError() during nazurin.models.file.File.download execution, 3 of 5 attempted.
2023-01-07 05:48:28,990 - tenacity.decorators - INFO - TimeoutError() during nazurin.models.file.File.download execution, 4 of 5 attempted.
2023-01-07 05:48:47,991 - tenacity.decorators - INFO - TimeoutError() during nazurin.models.file.File.download execution, 5 of 5 attempted.
Traceback (most recent call last):
File "/app/nazurin/__main__.py", line 56, in on_error
raise exception
File "/usr/local/lib/python3.8/site-packages/aiogram/dispatcher/dispatcher.py", line 1394, in process_response
response = task.result()
File "/app/nazurin/dispatcher.py", line 59, in update_collection
await self.bot.update_collection(urls, message)
File "/app/nazurin/bot.py", line 131, in update_collection
await asyncio.gather(save, download)
File "/app/nazurin/sites/pixiv/models.py", line 21, in download
await super().download(headers=HEADERS, **kwargs)
File "/app/nazurin/models/illust.py", line 35, in download
await asyncio.gather(*tasks)
File "/usr/local/lib/python3.8/site-packages/tenacity/_asyncio.py", line 48, in call
do = self.iter(retry_state=retry_state)
File "/usr/local/lib/python3.8/site-packages/tenacity/__init__.py", line 332, in iter
raise retry_exc.reraise()
File "/usr/local/lib/python3.8/site-packages/tenacity/__init__.py", line 168, in reraise
raise self.last_attempt.result()
File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 437, in result
return self.__get_result()
File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
raise self._exception
File "/usr/local/lib/python3.8/site-packages/tenacity/_asyncio.py", line 51, in call
result = yield from fn(*args, **kwargs)
File "/app/nazurin/models/file.py", line 46, in download
await f.write(await response.read())
File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1037, in read
self._body = await self.content.read()
File "/usr/local/lib/python3.8/site-packages/aiohttp/streams.py", line 375, in read
block = await self.readany()
File "/usr/local/lib/python3.8/site-packages/aiohttp/streams.py", line 397, in readany
await self._wait("readany")
File "/usr/local/lib/python3.8/site-packages/aiohttp/streams.py", line 304, in _wait
await waiter
File "/usr/local/lib/python3.8/site-packages/aiohttp/helpers.py", line 720, in __exit__
raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
Environment (please complete the following information):
Additional context
I have tried to refresh Pixiv token by #9, does not work.
Is your feature request related to a problem? Please describe.
网易 Lofter 也是**同人/内容产出的一个重要平台,但是目前 nazurin 并没有进行支持。
Describe the solution you'd like
lofter 分享的 URL 为 [blogName].lofter.com/post/[post-hash]
,使用移动端 UA 会返回一段 json,包裹在 <script>"window.__initialize_data__ = {}</script>"
中,其中包含了该 post 在网易后端唯一的 postid 和 blogId。
e.g.
https://wuyayayayaya.lofter.com/post/1e8b623c_12d0a4293
使用以下 UA 请求
User-Agent: Mozilla/5.0 (Linux; Android 9; SM-G960F Build/PPR1.180610.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Mobile Safari/537.36
会得到如 json
<script>window.__initialize_data__ = {
"permalink": "1e8b623c_12d0a4293",
"postData": {
"msg": "成功",
"code": 0,
"data": {
"blogInfo": {
"blogNickName": "灰鸦",
"bigAvaImg": "https://avaimg.lf127.net/img/WjU1U3R1ZkFwUGNQRi8xWEpnYVdvY1Nnb1RlTlhRNkwraTY3U3dWTnhJS3ovUE5PMlIxd2hBPT0.jpg?imageView",
"blogId": 512451132,
"isAuth": false,
"isVerify": false,
"blogName": "wuyayayayaya",
"selfIntro": "weibo@一定要早睡鸦。图片禁止二改,头像壁纸随意,转载请注明出处,请勿商用",
"imageProtected": true
},
"postData": {
"postView": {
"id": 5050614419,
"blogId": 512451132,
"title": "",
"type": 2,
"publishTime": 1544935531236,
"publisherUserId": 512451132,
"digest": "<p>这阵子的永七啦<br /></p>",
"tagList": [
"永远的七日之都",
"璃璃子",
"菲尼克",
"晏华",
"安",
"安托涅瓦",
"濑由衣",
"伊萨克",
"赛哈姆",
"永远的7日之都"
],
"permalink": "1e8b623c_12d0a4293",
"forbidShare": 0,
"allowReward": 1,
"top": 0,
"viewRank": 0,
"collectionId": 1210261,
"citeParentPostId": 0,
"citeParentBlogId": 0,
"citeRootPostId": 0,
"citeRootBlogId": 0,
"locationId": 0,
"photoCount": 8,
"ccType": 1,
"createTime": 0,
"photoPostView": {
"id": 5050614419,
"blogId": 512451132,
"caption": "<p>这阵子的永七啦<br /></p>",
"photoLinks": [
{
"orign": "https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdEZQRzBhSmRkcEpxNGlFZ3pGVmIwTVRsOXNkeEVWdkl3PT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0",
"ow": 2480,
"oh": 3507
},
{
"orign": "https://imglf6.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdVYxelhEOStYeDRlRHZ4dEFvZlJwNVJsS2crQUNKaG9nPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0",
"ow": 2375,
"oh": 2015
},
{
"orign": "https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEaCsxKzNSWCsyMGNCcGxYWHhCYVErdEcyNVRITUQ3VlR3PT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0",
"ow": 2480,
"oh": 2171
},
{
"orign": "https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdTJWZ1hDdkI0SmJ4Rk45R1JJK3FXMUNTOGxsUDVFSzZBPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0",
"ow": 2395,
"oh": 3569
},
{
"orign": "https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEbDRQOUlGWFZOYU8zOGR3ckdKMkZhRnhKYnl3dW5KeVZRPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0",
"ow": 2480,
"oh": 2591
},
{
"orign": "https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdkFOYUZBa28zdG9HMHhmVWIzRmNYYm8rVTkycDVUbWpBPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0",
"ow": 3507,
"oh": 2480
},
{
"orign": "https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEaTZuNllnczZrWTBZcHdKVTk0OUpySjZuR0szdGREcnJRPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0",
"ow": 3081,
"oh": 2104
},
{
"orign": "https://imglf3.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEbm03RmJHNzVDVEFIak00Z08xbmtBSk1aVFhtdE94VElBPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0",
"ow": 3096,
"oh": 2480
}
],
"photoCaptions": [
"",
"",
"",
"",
"",
"",
"",
""
],
"photoType": 0,
"firstImage": {
"orign": "https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdEZQRzBhSmRkcEpxNGlFZ3pGVmIwTVRsOXNkeEVWdkl3PT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0",
"ow": 2480,
"oh": 3507
}
},
"forbid": false,
"auditing": false,
"viewRankPublic": true,
"publicOut": true,
"firstImage": {
"orign": "https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdEZQRzBhSmRkcEpxNGlFZ3pGVmIwTVRsOXNkeEVWdkl3PT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0",
"ow": 2480,
"oh": 3507
},
"valid": 0,
"allowView": 0,
"isContribute": 0,
"payView": 0,
"published": true
},
"postCountView": {
"blogId": 512451132,
"responseCount": 76,
"favoriteCount": 8501,
"reblogCount": 1,
"shareCount": 2379,
"viewCount": 0,
"hotCount": 11022,
"subscribeCount": 141
}
}
}
}
}</script>
原始图片是 photolink section 的第一个?长宽分别为 ow
与 oh
这部分可以直接提取出图片,或者使用 id 与 blogid 向 lofter app API 请求
https://api.lofter.com/oldapi/post/detail.api
request body 为 plain text,格式为 postid=[id]&supportposttypes=1%2C2%2C3%2C4%2C5%2C6&targetblogid=[blogid]
request header 可能需要带上 lofter app 的 UA,并且原始请求也携带了 securityinfo
与 cookie
两个 header,不清楚在机房环境下会出现什么验证 azure hk 测试无验证
家宽和机房均使用以下 curl 测试
curl 'https://api.lofter.com/oldapi/post/detail.api' \
-H 'Host: api.lofter.com' \
-H 'User-Agent: LOFTER/6.24.0 (iPhone; iOS 15.4.1; Scale/3.00)' \
-H 'Accept: */*' \
-d 'postid=5050614419&supportposttypes=1%2C2%2C3%2C4%2C5%2C6&targetblogid=512451132' \
--compressed
返回为如下 json
{
"meta": {
"status": 200,
"msg": ""
},
"response": {
"posts": [
{
"post": {
"id": 5050614419,
"type": 2,
"blogId": 512451132,
"title": "",
"publisherUserId": 512451132,
"publishTime": 1544935531236,
"isPublished": true,
"allowView": 0,
"valid": 0,
"rank": 0,
"tag": "永远的七日之都,璃璃子,菲尼克,晏华,安,安托涅瓦,濑由衣,伊萨克,赛哈姆,永远的7日之都",
"citeParentPostId": 0,
"citeParentBlogId": 0,
"citeRootPostId": 0,
"citeRootBlogId": 0,
"isContribute": false,
"digest": "<p>这阵子的永七啦<br /></p>",
"firstImageUrl": "[\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdEZQRzBhSmRkcEpxNGlFZ3pGVmIwTVRsOXNkeEVWdkl3PT0.jpg?imageView&thumbnail=164y164&enlarge=1&quality=90&type=jpg\",\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdEZQRzBhSmRkcEpxNGlFZ3pGVmIwTVRsOXNkeEVWdkl3PT0.jpg?imageView&thumbnail=500x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=240&dx=8&dy=10&stripmeta=0\",\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdEZQRzBhSmRkcEpxNGlFZ3pGVmIwTVRsOXNkeEVWdkl3PT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0\"]",
"cctype": 1,
"locationId": 0,
"forbidShare": 0,
"allowReward": 1,
"showGift": 1,
"top": 0,
"collectionId": 1210261,
"payView": 0,
"content": "<p>这阵子的永七啦<br /></p>",
"pos": 2,
"blogInfo": {
"blogId": 512451132,
"blogName": "wuyayayayaya",
"blogNickName": "灰鸦",
"bigAvaImg": "https://avaimg.lf127.net/img/WjU1U3R1ZkFwUGNQRi8xWEpnYVdvY1Nnb1RlTlhRNkwraTY3U3dWTnhJS3ovUE5PMlIxd2hBPT0.jpg?imageView",
"avatarBoxImage": "",
"commentRank": 10,
"imageProtected": true,
"imageStamp": true,
"imageDigitStamp": true,
"auths": [],
"isOriginalAuthor": false,
"signAuth": false,
"homePageUrl": "https://wuyayayayaya.lofter.com",
"allowReward": 1,
"allowGift": 1
},
"publisherMainBlogInfo": {
"blogId": 512451132,
"blogName": "wuyayayayaya",
"blogNickName": "灰鸦",
"bigAvaImg": "https://avaimg.lf127.net/img/WjU1U3R1ZkFwUGNQRi8xWEpnYVdvY1Nnb1RlTlhRNkwraTY3U3dWTnhJS3ovUE5PMlIxd2hBPT0.jpg?imageView",
"avatarBoxImage": "",
"commentRank": 10,
"imageProtected": true,
"imageStamp": true,
"imageDigitStamp": true,
"auths": [],
"isOriginalAuthor": false,
"signAuth": false,
"homePageUrl": "https://wuyayayayaya.lofter.com",
"allowReward": 0,
"allowGift": 0
},
"postCount": {
"responseCount": 76,
"favoriteCount": 8501,
"reblogCount": 1,
"shareCount": 2379,
"viewCount": 0,
"subscribeCount": 141,
"postHot": 11022
},
"postCollection": {
"id": 1210261,
"blogId": 512451132,
"coverUrl": "https://imglf6.lf127.net/img/WjU1U3R1ZkFwUGRVdm95OElpL3FKMkl0WTNwNkVXTWtRZFNCM01sS05LMFh2K2RjdVoxUk1nPT0.jpg?imageView&thumbnail=800y800&enlarge=1&type=jpg",
"name": "永七",
"description": "",
"tags": "永远的7日之都",
"status": 0,
"createTime": 1547871491788,
"updateTime": 0,
"lastPublishTime": 1585918147836,
"postCount": 9,
"viewCount": 0,
"subscribed": false,
"favoriteCount": 0,
"collectionType": 0
},
"payViewExpire": false,
"newVersionAuditing": false,
"applyStatus": 0,
"caption": "<p>这阵子的永七啦<br /></p>",
"photoLinks": "[{\"id\":\"tastId-6281665670\",\"ow\":2480,\"oh\":3507,\"raw\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdEZQRzBhSmRkcEpxNGlFZ3pGVmIwTVRsOXNkeEVWdkl3PT0.jpg\",\"rw\":2480,\"rh\":3507,\"rotate\":0,\"small\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdEZQRzBhSmRkcEpxNGlFZ3pGVmIwTVRsOXNkeEVWdkl3PT0.jpg?imageView&thumbnail=164y164&enlarge=1&quality=90&type=jpg\",\"middle\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdEZQRzBhSmRkcEpxNGlFZ3pGVmIwTVRsOXNkeEVWdkl3PT0.jpg?imageView&thumbnail=500x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=240&dx=8&dy=10&stripmeta=0\",\"orign\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdEZQRzBhSmRkcEpxNGlFZ3pGVmIwTVRsOXNkeEVWdkl3PT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0\"},{\"id\":\"tastId-2764501994\",\"ow\":2375,\"oh\":2015,\"raw\":\"https://imglf6.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdVYxelhEOStYeDRlRHZ4dEFvZlJwNVJsS2crQUNKaG9nPT0.jpg\",\"rw\":2375,\"rh\":2015,\"rotate\":0,\"small\":\"https://imglf6.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdVYxelhEOStYeDRlRHZ4dEFvZlJwNVJsS2crQUNKaG9nPT0.jpg?imageView&thumbnail=164y164&enlarge=1&quality=90&type=jpg\",\"middle\":\"https://imglf6.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdVYxelhEOStYeDRlRHZ4dEFvZlJwNVJsS2crQUNKaG9nPT0.jpg?imageView&thumbnail=500x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=240&dx=8&dy=10&stripmeta=0\",\"orign\":\"https://imglf6.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdVYxelhEOStYeDRlRHZ4dEFvZlJwNVJsS2crQUNKaG9nPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0\"},{\"id\":\"tastId-2847368273\",\"ow\":2480,\"oh\":2171,\"raw\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEaCsxKzNSWCsyMGNCcGxYWHhCYVErdEcyNVRITUQ3VlR3PT0.jpg\",\"rw\":2480,\"rh\":2171,\"rotate\":0,\"small\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEaCsxKzNSWCsyMGNCcGxYWHhCYVErdEcyNVRITUQ3VlR3PT0.jpg?imageView&thumbnail=164y164&enlarge=1&quality=90&type=jpg\",\"middle\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEaCsxKzNSWCsyMGNCcGxYWHhCYVErdEcyNVRITUQ3VlR3PT0.jpg?imageView&thumbnail=500x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=240&dx=8&dy=10&stripmeta=0\",\"orign\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEaCsxKzNSWCsyMGNCcGxYWHhCYVErdEcyNVRITUQ3VlR3PT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0\"},{\"id\":\"tastId-7271377457\",\"ow\":2395,\"oh\":3569,\"raw\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdTJWZ1hDdkI0SmJ4Rk45R1JJK3FXMUNTOGxsUDVFSzZBPT0.jpg\",\"rw\":2395,\"rh\":3569,\"rotate\":0,\"small\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdTJWZ1hDdkI0SmJ4Rk45R1JJK3FXMUNTOGxsUDVFSzZBPT0.jpg?imageView&thumbnail=164y164&enlarge=1&quality=90&type=jpg\",\"middle\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdTJWZ1hDdkI0SmJ4Rk45R1JJK3FXMUNTOGxsUDVFSzZBPT0.jpg?imageView&thumbnail=500x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=240&dx=8&dy=10&stripmeta=0\",\"orign\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdTJWZ1hDdkI0SmJ4Rk45R1JJK3FXMUNTOGxsUDVFSzZBPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0\"},{\"id\":\"tastId-4218259342\",\"ow\":2480,\"oh\":2591,\"raw\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEbDRQOUlGWFZOYU8zOGR3ckdKMkZhRnhKYnl3dW5KeVZRPT0.jpg\",\"rw\":2480,\"rh\":2591,\"rotate\":0,\"small\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEbDRQOUlGWFZOYU8zOGR3ckdKMkZhRnhKYnl3dW5KeVZRPT0.jpg?imageView&thumbnail=164y164&enlarge=1&quality=90&type=jpg\",\"middle\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEbDRQOUlGWFZOYU8zOGR3ckdKMkZhRnhKYnl3dW5KeVZRPT0.jpg?imageView&thumbnail=500x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=240&dx=8&dy=10&stripmeta=0\",\"orign\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEbDRQOUlGWFZOYU8zOGR3ckdKMkZhRnhKYnl3dW5KeVZRPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0\"},{\"id\":\"tastId-1301116982\",\"ow\":3507,\"oh\":2480,\"raw\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdkFOYUZBa28zdG9HMHhmVWIzRmNYYm8rVTkycDVUbWpBPT0.jpg\",\"rw\":3507,\"rh\":2480,\"rotate\":0,\"small\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdkFOYUZBa28zdG9HMHhmVWIzRmNYYm8rVTkycDVUbWpBPT0.jpg?imageView&thumbnail=164y164&enlarge=1&quality=90&type=jpg\",\"middle\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdkFOYUZBa28zdG9HMHhmVWIzRmNYYm8rVTkycDVUbWpBPT0.jpg?imageView&thumbnail=500x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=240&dx=8&dy=10&stripmeta=0\",\"orign\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdkFOYUZBa28zdG9HMHhmVWIzRmNYYm8rVTkycDVUbWpBPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0\"},{\"id\":\"tastId-5735199854\",\"ow\":3081,\"oh\":2104,\"raw\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEaTZuNllnczZrWTBZcHdKVTk0OUpySjZuR0szdGREcnJRPT0.jpg\",\"rw\":3081,\"rh\":2104,\"rotate\":0,\"small\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEaTZuNllnczZrWTBZcHdKVTk0OUpySjZuR0szdGREcnJRPT0.jpg?imageView&thumbnail=164y164&enlarge=1&quality=90&type=jpg\",\"middle\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEaTZuNllnczZrWTBZcHdKVTk0OUpySjZuR0szdGREcnJRPT0.jpg?imageView&thumbnail=500x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=240&dx=8&dy=10&stripmeta=0\",\"orign\":\"https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEaTZuNllnczZrWTBZcHdKVTk0OUpySjZuR0szdGREcnJRPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0\"},{\"id\":\"tastId-8978499314\",\"ow\":3096,\"oh\":2480,\"raw\":\"https://imglf3.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEbm03RmJHNzVDVEFIak00Z08xbmtBSk1aVFhtdE94VElBPT0.jpg\",\"rw\":3096,\"rh\":2480,\"rotate\":0,\"small\":\"https://imglf3.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEbm03RmJHNzVDVEFIak00Z08xbmtBSk1aVFhtdE94VElBPT0.jpg?imageView&thumbnail=164y164&enlarge=1&quality=90&type=jpg\",\"middle\":\"https://imglf3.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEbm03RmJHNzVDVEFIak00Z08xbmtBSk1aVFhtdE94VElBPT0.jpg?imageView&thumbnail=500x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=240&dx=8&dy=10&stripmeta=0\",\"orign\":\"https://imglf3.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEbm03RmJHNzVDVEFIak00Z08xbmtBSk1aVFhtdE94VElBPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg54Gw5LmM6bimIC8gd3V5YXlheWF5YXlhLmxvZnRlci5jb20=&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0\"}]",
"photoCaptions": "[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]",
"photoType": 0,
"firstSmallImageUrl": "https://imglf4.lf127.net/img/WjU1U3R1ZkFwUGVhYkFEOGNrZnFEdEZQRzBhSmRkcEpxNGlFZ3pGVmIwTVRsOXNkeEVWdkl3PT0.jpg?imageView&thumbnail=164y164&enlarge=1&quality=90&type=jpg",
"firstImageWH": [
2480,
3507
],
"tagList": [
"永远的七日之都",
"璃璃子",
"菲尼克",
"晏华",
"安",
"安托涅瓦",
"濑由衣",
"伊萨克",
"赛哈姆",
"永远的7日之都"
],
"viewRank": 0,
"needPay": false,
"permalink": "1e8b623c_12d0a4293",
"dirPostType": 2,
"citeParentPermalink": "0_0",
"blogPageUrl": "https://wuyayayayaya.lofter.com/post/1e8b623c_12d0a4293",
"hot": 11022,
"cited": false,
"payViewPost": false,
"payingView": false
},
"liked": false,
"shared": false,
"subscribed": false,
"followed": 0,
"misc": "{\"rootFollowed\":\"0\",\"parentFollowed\":\"0\"}",
"showLuckyBoy": false
}
]
}
}
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Lofter 和其他平台的 URL 格式不同,为 [blogName].lofter.com/post/[post-hash]
,不接受使用主域名 www.lofter.com
替换博客域名进行请求,而目前 nazurin 只会对 URI 部分 parse,可能添加支持要 3.0 改掉 parse 逻辑才有机会了吧。
Describe the bug
DeviantArt API (https://www.deviantart.com/_napi/da-user-profile/shared_api/deviation/extended_fetch?type=art&deviationid=) now requires a valid CSRF token to be passed via csrf_token
parameter.
To Reproduce
Steps to reproduce the behavior:
{
"error": "invalid_request",
"errorDescription": "Invalid or expired form submission",
"errorDetails": {
"csrf": "missing"
},
"status": "error"
}
Expected behavior
Should be able to get deviation details.
Additional context
{
"error": "invalid_request",
"errorDescription": "Invalid or expired form submission",
"errorDetails": {
"csrf": "invalid"
},
"status": "error"
}
window.__CSRF_TOKEN__
(mikf/gallery-dl#2983)userinfo
), otherwise will be considered invalidDescribe the bug
When sending it an untitled Pixiv work, it will report an error: Error: 'NoneType' object has no attribute 'reply'
To Reproduce
Steps to reproduce the behavior:
Send https://www.pixiv.net/artworks/84247460
Error output / Logs
2021-06-14T12:57:21.920904+00:00 app[web.1]: 2021-06-14 12:57:21,916 - nazurin - INFO - Collection update: site=Pixiv, match=('84247460',)
2021-06-14T12:57:21.952182+00:00 app[web.1]: 2021-06-14 12:57:21,950 - aiohttp.access - **delete**
2021-06-14T12:57:22.714919+00:00 app[web.1]: 2021-06-14 12:57:22,714 - nazurin - INFO - Bookmarked artwork 84247460
2021-06-14T12:57:27.817956+00:00 app[web.1]: 2021-06-14 12:57:27,817 - nazurin - ERROR - BadRequest exception: Group send failed
2021-06-14T12:57:27.818677+00:00 app[web.1]: 2021-06-14 12:57:27,818 - nazurin - ERROR - Update **delete**
2021-06-14T12:57:27.819201+00:00 app[web.1]: Traceback (most recent call last):
2021-06-14T12:57:27.819287+00:00 app[web.1]: File "/app/nazurin/bot.py", line 77, in sendIllust
2021-06-14T12:57:27.819288+00:00 app[web.1]: await self.sendPhotos(illust, chat_id, reply_to)
2021-06-14T12:57:27.819292+00:00 app[web.1]: File "/app/nazurin/bot.py", line 60, in sendPhotos
2021-06-14T12:57:27.819296+00:00 app[web.1]: await self.sendSingleGroup(group, caption, chat_id, reply_to)
2021-06-14T12:57:27.819321+00:00 app[web.1]: File "/app/nazurin/utils/decorators.py", line 51, in decorator
2021-06-14T12:57:27.819322+00:00 app[web.1]: result = await func(*args, **kwargs)
2021-06-14T12:57:27.819326+00:00 app[web.1]: File "/app/nazurin/bot.py", line 41, in sendSingleGroup
2021-06-14T12:57:27.819326+00:00 app[web.1]: await self.send_media_group(chat_id,
2021-06-14T12:57:27.819412+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/bot/bot.py", line 1017, in send_media_group
2021-06-14T12:57:27.819413+00:00 app[web.1]: result = await self.request(api.Methods.SEND_MEDIA_GROUP, payload, files)
2021-06-14T12:57:27.819413+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/bot/base.py", line 208, in request
2021-06-14T12:57:27.819414+00:00 app[web.1]: return await api.make_request(self.session, self.server, self.__token, method, data, files,
2021-06-14T12:57:27.819414+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/bot/api.py", line 140, in make_request
2021-06-14T12:57:27.819414+00:00 app[web.1]: return check_result(method, response.content_type, response.status, await response.text())
2021-06-14T12:57:27.819415+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/bot/api.py", line 115, in check_result
2021-06-14T12:57:27.819415+00:00 app[web.1]: exceptions.BadRequest.detect(description)
2021-06-14T12:57:27.819416+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/utils/exceptions.py", line 141, in detect
2021-06-14T12:57:27.819416+00:00 app[web.1]: raise cls(description)
2021-06-14T12:57:27.819421+00:00 app[web.1]: aiogram.utils.exceptions.BadRequest: Group send failed
2021-06-14T12:57:27.819453+00:00 app[web.1]:
2021-06-14T12:57:27.819454+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2021-06-14T12:57:27.819455+00:00 app[web.1]:
2021-06-14T12:57:27.819458+00:00 app[web.1]: Traceback (most recent call last):
2021-06-14T12:57:27.819532+00:00 app[web.1]: File "/app/nazurin/__main__.py", line 53, in on_error
2021-06-14T12:57:27.819533+00:00 app[web.1]: raise exception
2021-06-14T12:57:27.819539+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/aiogram/dispatcher/dispatcher.py", line 1340, in process_response
2021-06-14T12:57:27.819539+00:00 app[web.1]: response = task.result()
2021-06-14T12:57:27.819562+00:00 app[web.1]: File "/app/nazurin/dispatcher.py", line 52, in update_collection
2021-06-14T12:57:27.819563+00:00 app[web.1]: await self.bot.updateCollection(urls, message)
2021-06-14T12:57:27.819566+00:00 app[web.1]: File "/app/nazurin/bot.py", line 122, in updateCollection
2021-06-14T12:57:27.819567+00:00 app[web.1]: await asyncio.gather(save, download)
2021-06-14T12:57:27.819594+00:00 app[web.1]: File "/app/nazurin/bot.py", line 79, in sendIllust
2021-06-14T12:57:27.819595+00:00 app[web.1]: await handleBadRequest(message, error)
2021-06-14T12:57:27.819598+00:00 app[web.1]: File "/app/nazurin/utils/helpers.py", line 25, in handleBadRequest
2021-06-14T12:57:27.819599+00:00 app[web.1]: await message.reply(
2021-06-14T12:57:27.819646+00:00 app[web.1]: AttributeError: 'NoneType' object has no attribute 'reply'
Environment (please complete the following information):
参考 #80 ,Twitter (X) 仍对接口调用有限制,旧版本 Nazurin 会报错 Response Error: 0 Attempt to decode JSON with unexpected mimetype:
,新版本 Nazurin 会报错 Twitter web API error:
。
希望 Nazurin 引入绕过 Twitter (X) 接口限制的措施,具体如下:
Nitter 是一个活跃地维护的 Twitter (X) 的隐私替代前端,可以支持 Nitter 以绕过 Twitter (X) 的直接限制。
用户应当可以自行配置两个 list,允许用户自定义 Nitter 实例作为 Twitter (X) 的替代方案,如:
X_FIX_LINK = ["fxtwitter.com", "vxtwitter.com", ]
NITTER_INST = ["nitter.net", "nitter.it", ]
X_FIX_LINK
用于接受 Fix Twitter Link 服务的链接,即遇到这些域,可以视为 twitter.com
继续处理。也可以在程序中预置这些域,推荐参考 https://github.com/jonjomckay/fritter/blob/master/android/app/src/main/AndroidManifest.xml 内给出的域列表。
NITTER_INST
用于配置 Nitter 实例的域。当 NITTER_INST
未配置或为空 List 时,应当仅向 twitter.com
发出请求。当 NITTER_INST
已配置时,应当先请求 twitter.com
,如失败再依次向 NITTER_INST
中的实例请求,直到成功或没有可用的实例。
一些第三方客户端已经引入了绕过 Twitter (X) 接口限制的方法,如 TheHCJ/Quacker 和 j-fbriere/squawker ,可以作为参考。
希望您可以参考上述两种方案引入绕过 Twitter (X) 接口限制的措施,谢谢。
The current single admin limit is very serious, I want to share it with friends
So I want to ask the author for support, no admin\multi-admin\group whitelist
希望可以完成在网上找到一张好看的图,然后可以丢进bot自动搜索然后得出原图链接并且自动下载
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
The temp folder can take up several gigabytes of space.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Clean up the temp folder automatically.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Manually clean up or use a time-based job scheduler.
Additional context
Add any other context or screenshots about the feature request here.
Auto clean up by size or time?
CC @ovrase
看到这个机器人不错,但是没有上传网盘的功能,大佬能不能整合一下这个。
https://github.com/Yash-Garg/node-wallhaven-bot
Describe the bug
Pixiv request encountered Cloudflare Captcha on my instance deployed on Heroku.
The error given is error: Cloudflare Captcha detected, unfortunately you haven't loaded an anti Captcha provider correctly via the 'captcha' parameter
.
I did not see the relevant description after checking the documention. Should I directly report it to the upstream dependencies?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
works as before
Error output / Logs
Logs are usually critical to identify the cause of a bug, please paste the complete log from start to end.
Make sure to remove or mask all secrets, such as bot token and personal information!
heroku logs
2021-06-08T11:58:51.059296+00:00 app[web.1]: 2021-06-08 11:58:51,059 - nazurin - INFO - Collection update: site=Pixiv, match=('90212133',)
2021-06-08T11:58:51.069183+00:00 heroku[router]: at=info method=POST path="/TELEGRAM_BOT_TOKEN" host=misakapicbot.herokuapp.com request_id=31c8bbdc-6567-4efb-9fe1-b1c95f0541fa fwd="91.108.6.58" dyno=web.1 connect=1ms service=14ms status=200 bytes=177 protocol=https
2021-06-08T11:58:51.071453+00:00 app[web.1]: 2021-06-08 11:58:51,071 - aiohttp.access - INFO - 10.97.186.122 [08/Jun/2021:11:58:51 +0000] "POST /TELEGRAM_BOT_TOKEN HTTP/1.1" 200 177 "-" "-"
2021-06-08T11:58:51.227486+00:00 app[web.1]: 2021-06-08 11:58:51,226 - nazurin - ERROR - Update {"update_id": 803740216, "message": {"message_id": 6640, "from": [private], "chat": [private], "date": 1623153530, "forward_from": [private], "forward_date": 1623126077, "text": "https://www.pixiv.net/artworks/90212133", "entities": [{"type": "url", "offset": 0, "length": 39}]}} caused <class 'pixivpy3.utils.PixivError'>: requests POST https://oauth.secure.pixiv.net/auth/token error: Cloudflare Captcha detected, unfortunately you haven't loaded an anti Captcha provider correctly via the 'captcha' parameter.
2021-06-08T11:58:51.227860+00:00 app[web.1]: cloudscraper.exceptions.CloudflareCaptchaProvider: Cloudflare Captcha detected, unfortunately you haven't loaded an anti Captcha provider correctly via the 'captcha' parameter.
2021-06-08T11:58:51.227866+00:00 app[web.1]:
2021-06-08T11:58:51.227867+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2021-06-08T11:58:51.227867+00:00 app[web.1]:
2021-06-08T11:58:51.227869+00:00 app[web.1]: pixivpy3.utils.PixivError: requests POST https://oauth.secure.pixiv.net/auth/token error: Cloudflare Captcha detected, unfortunately you haven't loaded an anti Captcha provider correctly via the 'captcha' parameter.
Environment (please complete the following information):
deploy to heroku with default config
Additional context
I encountered this error in the last two days.
Describe the bug
An error occurs when the configuration is completed and started.
To Reproduce
Steps to reproduce the behavior:
Error output / Logs
2024-01-17 14:17:44,749+0000 - ERROR - asyncio.base_events:1758 - - unhandled exception during asyncio.run() shutdown
task: <Task finished name='Task-7' coro=<_run_app() done, defined at /usr/local/lib/python3.10/dist-packages/aiohttp/web.py:289> exception=TypeError('As of 3.10, the *loop* parameter was removed from Queue() since it is no longer necessary')>
Environment (please complete the following information):
Additional context
The python that comes with Ubuntu has been upgraded to 3.10, but there are deprecated parameters in the program.
Is your feature request related to a problem? Please describe.
Sometimes multiple pictures from the same link are combined and sent as a group, and the bot will only forward one picture to the gallery channel.
Describe the solution you'd like
Forward all pictures in the picture group to the telegram gallery channel
Describe alternatives you've considered
Now I can only manually copy the link of the picture group (from other channel) and send it to the bot.
Additional context
I don't know if this can be done. 😓
Describe the bug
Weibo cannot get the correct original image, GALLERY sent normally.
To Reproduce
Steps to reproduce the behavior:
Error output / Logs
There does not seem to be a valid log
2022-11-20 09:49:29,205 - nazurin.__init__ - INFO - Loaded 12 sites
2022-11-20 09:49:29,207 - nazurin.__init__ - INFO - Loaded 1 storage(s), using: ['Telegram']
2022-11-20 09:49:29,708 - aiogram.executor - INFO - Bot: **********
2022-11-20 09:49:30,035 - aiogram.executor - WARNING - Updates were skipped successfully.
2022-11-20 09:49:30,036 - aiogram.dispatcher.dispatcher.dispatcher - INFO - Start polling.
2022-11-20 09:51:54,307 - nazurin.bot - INFO - Collection update: site=weibo, match=('MfUPJzuoK',)
2022-11-20 09:51:58,235 - nazurin.__init__ - INFO - Storage completed
Environment (please complete the following information):
Twitter更改API政策後,NSFW推文資料無法正常獲取,回應 Tweet not found or unavailable.
。
这应该是一个错误。手机微博端生成类似 https://m.weibo.cn/******/****** 的链接,对其域名替换为 weibo.com 后就可以正常识别,理应能够识别手机端这种变体的,但是在轮训模式下向其发送链接时会提示无法识别链接。希望能够修正这个问题。
Describe the bug
当STORAGE环境变量填多个存储报错,但是在其他issue看到应该是支持多个存储的
Expected behavior
A clear and concise description of what you expected to happen.
Error output / Logs
2022-08-10T09:19:26.380725+00:00 heroku[web.1]: State changed from crashed to starting
2022-08-10T09:19:33.368193+00:00 heroku[web.1]: Starting process with command `python -m nazurin`
2022-08-10T09:19:35.082434+00:00 app[web.1]: 2022-08-10 09:19:35,082 - nazurin - INFO - Sites loaded
2022-08-10T09:19:35.082563+00:00 app[web.1]: Traceback (most recent call last):
2022-08-10T09:19:35.082571+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/runpy.py", line 194, in _run_module_as_main
2022-08-10T09:19:35.082704+00:00 app[web.1]: return _run_code(code, main_globals, None,
2022-08-10T09:19:35.082712+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/runpy.py", line 87, in _run_code
2022-08-10T09:19:35.082784+00:00 app[web.1]: exec(code, run_globals)
2022-08-10T09:19:35.082786+00:00 app[web.1]: File "/app/nazurin/__main__.py", line 73, in <module>
2022-08-10T09:19:35.082861+00:00 app[web.1]: main()
2022-08-10T09:19:35.082863+00:00 app[web.1]: File "/app/nazurin/__main__.py", line 70, in main
2022-08-10T09:19:35.082932+00:00 app[web.1]: dp.start()
2022-08-10T09:19:35.082934+00:00 app[web.1]: File "/app/nazurin/dispatcher.py", line 42, in start
2022-08-10T09:19:35.082993+00:00 app[web.1]: self.init()
2022-08-10T09:19:35.082995+00:00 app[web.1]: File "/app/nazurin/dispatcher.py", line 27, in init
2022-08-10T09:19:35.083049+00:00 app[web.1]: self.bot.init()
2022-08-10T09:19:35.083051+00:00 app[web.1]: File "/app/nazurin/bot.py", line 28, in init
2022-08-10T09:19:35.083108+00:00 app[web.1]: self.storage.load()
2022-08-10T09:19:35.083109+00:00 app[web.1]: File "/app/nazurin/storage/__init__.py", line 16, in load
2022-08-10T09:19:35.083165+00:00 app[web.1]: driver = importlib.import_module('nazurin.storage.' +
2022-08-10T09:19:35.083166+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
2022-08-10T09:19:35.083240+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-08-10T09:19:35.083241+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2022-08-10T09:19:35.083313+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2022-08-10T09:19:35.083346+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
2022-08-10T09:19:35.083397+00:00 app[web.1]: ModuleNotFoundError: No module named "nazurin.storage.['onedrive'"
Environment (please complete the following information):
heroku部署
Additional context
Add any other context about the problem here.
Describe the bug
尝试发送推特链接时报错
Error output / Logs
======== Running on http://0.0.0.0:7900 ========
(Press CTRL+C to quit)
2023-07-10 11:24:02,542-0400 - INFO - nazurin.bot:167 - - Cleaned up temporary directory
2023-07-10 11:24:05,248-0400 - INFO - nazurin.middleware:25 - update:658614606 - Message 568: https://twitter.com/benevolels/status/1677592346597408768
2023-07-10 11:24:05,260-0400 - INFO - nazurin.bot:123 - update:658614606 - Collection update: site=twitter, match=('1677592346597408768',)
2023-07-10 11:24:05,270-0400 - INFO - nazurin.sites.twitter.api.web:114 - update:658614606 - Fetching tweet 1677592346597408768 from web API
2023-07-10 11:24:05,271-0400 - INFO - nazurin.sites.twitter.api.web:178 - update:658614606 - Fetching guest token
2023-07-10 11:24:05,275-0400 - INFO - aiohttp.web_log:206 - - 127.0.0.1 "POST /这里是bot token HTTP/1.0" 200 152 "-" "-"
2023-07-10 11:24:05,355-0400 - INFO - nazurin.sites.twitter.api.web:188 - update:658614606 - Fetched guest token: 1678424729982730241
Traceback (most recent call last):
File "/root/nazurin-new/nazurin/__main__.py", line 91, in on_error
raise exception
File "/usr/local/lib/python3.9/dist-packages/aiogram/dispatcher/dispatcher.py", line 1394, in process_response
response = task.result()
File "/root/nazurin-new/nazurin/dispatcher.py", line 119, in update_collection
await self.bot.update_collection(urls, message)
File "/root/nazurin-new/nazurin/bot.py", line 129, in update_collection
illust = await self.sites.handle_update(result)
File "/root/nazurin-new/nazurin/sites/__init__.py", line 68, in handle_update
return await handle(result["match"])
File "/root/nazurin-new/nazurin/sites/twitter/interface.py", line 22, in handle
illust = await Twitter().fetch(status_id)
File "/root/nazurin-new/nazurin/sites/twitter/api/__init__.py", line 17, in fetch
return await Twitter.web.fetch(status_id)
File "/root/nazurin-new/nazurin/sites/twitter/api/web.py", line 84, in fetch
tweet = await self.tweet_detail(status_id)
File "/root/nazurin-new/nazurin/sites/twitter/api/web.py", line 123, in tweet_detail
response = await self._request("GET", api, params=params)
File "/usr/local/lib/python3.9/dist-packages/tenacity/_asyncio.py", line 48, in call
do = self.iter(retry_state=retry_state)
File "/usr/local/lib/python3.9/dist-packages/tenacity/__init__.py", line 320, in iter
return fut.result()
File "/usr/lib/python3.9/concurrent/futures/_base.py", line 433, in result
return self.__get_result()
File "/usr/lib/python3.9/concurrent/futures/_base.py", line 389, in __get_result
raise self._exception
File "/usr/local/lib/python3.9/dist-packages/tenacity/_asyncio.py", line 51, in call
result = yield from fn(*args, **kwargs)
File "/root/nazurin-new/nazurin/sites/twitter/api/web.py", line 144, in _request
result = await response.json()
File "/usr/local/lib/python3.9/dist-packages/aiohttp/client_reqrep.py", line 1104, in json
raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://twitter.com/i/api/graphql/1oIoGPTOJN2mSjbbXlQifA/TweetDetail?variables=%7B%22with_rux_injections%22:+false,+%22includePromotedContent%22:+false,+%22withCommunity%22:+true,+%22withQuickPromoteEligibilityTweetFields%22:+false,+%22withBirdwatchNotes%22:+false,+%22withDownvotePerspective%22:+false,+%22withReactionsMetadata%22:+false,+%22withReactionsPerspective%22:+false,+%22withVoice%22:+true,+%22withV2Timeline%22:+true,+%22focalTweetId%22:+%221677592346597408768%22%7D&features=%7B%22blue_business_profile_image_shape_enabled%22:+false,+%22responsive_web_graphql_exclude_directive_enabled%22:+true,+%22verified_phone_label_enabled%22:+false,+%22responsive_web_graphql_timeline_navigation_enabled%22:+true,+%22responsive_web_graphql_skip_user_profile_image_extensions_enabled%22:+false,+%22tweetypie_unmention_optimization_enabled%22:+true,+%22vibe_api_enabled%22:+true,+%22responsive_web_edit_tweet_api_enabled%22:+true,+%22graphql_is_translatable_rweb_tweet_is_translatable_enabled%22:+false,+%22view_counts_everywhere_api_enabled%22:+true,+%22longform_notetweets_consumption_enabled%22:+true,+%22tweet_awards_web_tipping_enabled%22:+false,+%22freedom_of_speech_not_reach_fetch_enabled%22:+false,+%22standardized_nudges_misinfo%22:+true,+%22tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled%22:+false,+%22interactive_text_enabled%22:+true,+%22responsive_web_text_conversations_enabled%22:+false,+%22longform_notetweets_richtext_consumption_enabled%22:+false,+%22responsive_web_enhance_cards_enabled%22:+false%7D')
Make sure to remove or mask all secrets, such as bot token and personal information!
Environment (please complete the following information):
Python 3.9.2
Debian系统
Additional context
看了一下,在7月7号凌晨一点还是可以正常使用的,到了7月7号十二点就报错了...试了一下浏览器无痕模式不登陆的情况下是可以正常访问推文的,应该和推特之前的措施无关
Describe the bug
把mega网盘作为存储仓库,填入配置文件后报错。文件没有上传至mega网盘中。
To Reproduce
Steps to reproduce the behavior:
Mega
填写至存储配置值中。Error: (TypeError) string indices must be integers
。telegram
,Mega
两种存储配置,可以正常上传至Telegram频道储存,但是无法上传至Mega网盘。Expected behavior
希望可以正常上传至mega网盘。
Error output / Logs
Logs are usually critical to identify the cause of a bug, please paste the complete log from start to end.
File "/usr/local/lib/python3.8/dist-packages/mega/mega.py", line 910, in create_folder
existing_node_id = self.find_path_descriptor(current_path, files)
│ │ │ └ {'SI4TULaK': {'h': 'SI4TULaK', 'p': '', 'u': 'MTwSD0I4Hu4', 't': 2, 'a': {'n': 'Cloud Drive'}, 'ts': 1446988396}, 'SIIBCDyQ':...
│ │ └ 'pic/Twitter'
│ └ <function Mega.find_path_descriptor at 0x7f33227eadc0>
└ <mega.mega.Mega object at 0x7f3322c05310>
File "/usr/local/lib/python3.8/dist-packages/mega/mega.py", line 306, in find_path_descriptor
and file[1]['a']['n'] == foldername):
│ └ 'Twitter'
└ ('uEwQWJ6D', {'h': 'uEwQWJ6D', 'p': 'zQZ3Wa5a', 'u': 'MTwSD0I4Hu4', 't': 1, 'a': 'bgQAKVjtmOgzURH5LR1EwTE057gc4Pw7PzP7-peTHr6...
TypeError: string indices must be integers
Environment (please complete the following information):
Ubuntu 20.04 LTS
3.8.10
Additional context
无
Describe the bug
cdn.syndication.twimg.com
returns a 404 page now instead of JSON data.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Tweet images will be stored and sent to the Telegram channel.
Error output / Logs
Since the unexpected output happens on Twitter's side, no error log output from Nazurin.
Environment (please complete the following information):
Additional context
Since it should be a problem on Twitter's side, using another data source might be helpful (ex. nitter.it
).
Describe the bug
Grab Twitter dynamic pictures/videos fail
To Reproduce
Send https://twitter.com/itpiki/status/1778032367107805477
See error
Error output / Logs
Error: (ValidationError) 3 validation errors for Document
id.int
Input should be a valid integer [type=int_type, input_value=File(name='17780323671078... _destination='Twitter'), input_type=File]
For further information visit https://errors.pydantic.dev/2.5/v/int_type
id.str
Input should be a valid string [type=string_type, input_value=File(name='17780323671078... _destination='Twitter'), input_type=File]
For further information visit https://errors.pydantic.dev/2.5/v/string_type
data
Input should be a valid dictionary [type=dict_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.5/v/dict_type
OS: Ubuntu 22.04.4 LTS
Python: 3.10.12
Additional context
It should have started to appear in the latest releases.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.