caolvchong-top / twitter_download

推特 图片 视频 爬虫;一键下载
277 stars 33 forks source link

How to download tweet videos, images and text from a series of tweet urls? #59

Closed Rullec closed 2 hours ago

Rullec commented 2 weeks ago

Dear author,

Thanks a lot for your effor for this project! I really benefits a lot from it.

Recently, I am downloading a series of tweets from their urls. For example, I have a series of URLs:

https://x.com/KLTHOMPSON/status/1806450421902279114
https://x.com/JoeBiden/status/1806746426904379543
https://x.com/TorontoPolice/status/1808289625426808997
...

How can I download these tweets by this amazing framework? I really feel hard to modify it and extract the functions I need.

Thanks a lot! XD

Bests, Rullec

caolvchong-top commented 1 week ago

Thank you for your interest.

Currently, the project allows for downloading media files by specifying user IDs or tags, but it doesn’t support direct downloads from given URLs.

You can configure the 'settings.json' file and run this tool:

"user_lst": "KLTHOMPSON,JoeBiden,TorontoPolice",
"user_lst_info": "Enter the usernames (the part after @) of the users you want to download from, separated by commas.",

"cookie": "auth_token=xxxxxxxxxxx; ct0=xxxxxxxxxxx;",
"cookie_info": "Enter the cookie (auth_token and ct0 fields). Important: Replace the 'xxx', but do not remove the semicolons.",

"time_range": "1990-01-01:2030-01-01",
"time_range_info": "Set the time range in the format 1990-01-01:2030-01-01. If not set, the default is no limit.",

Leave the rest of the settings as default and run the program using:

python3 main.py

I hope this helps. If you have any further questions, feel free to ask.