Batch download all images and videos from a Twitter/X account, including withheld accounts, in original quality.
< 脚本Twitter/X Media Batch Downloader的反馈
By the way, this is the Pixiv script I personally use:
https://sleazyfork.org/zh-CN/scripts/432150-pixiv-downloader
The feature requests and suggestions I made are also influenced by this script, because the features I mentioned above are all available in this script, and they work perfectly. It's just that it is designed for Pixiv.
For now, I will add the second request, and for the fourth request, could you provide an example of a username that has GIF media?
Thank You! Of course!
Here are some Twitter artists and pixel artists I follow, who mainly post GIFs. (Please note that some of the users below are NSFW artists, so be cautious when opening them in public! I apologize for following more NSFW artists, and it's a bit hard to find 'clean' GIF artists at the moment, but I've tried to find a few wholesome GIF artists and pixel artists as references.)
https://x.com/PPechka/media
https://x.com/1TZAH/media
https://x.com/birdman46049238/media
https://x.com/PPechka/media
https://x.com/shiros_shin/media
https://x.com/Aduare_rp/media
https://x.com/raptorBR_/media
https://x.com/ni_no/media
https://x.com/RPS_dot/media
https://x.com/CAT02A/media
https://x.com/rdnm2386/media
https://x.com/sirok0707/media
Version 2.0 Update
GIF Support:
Now supports GIF. However, since the source format is .mp4
, it needs to be converted to .gif
. You can use tools like FFmpeg Media Encoder. Alternatively, I may need to implement the gif.js
library to handle this directly without manual conversion—this requires further exploration.
Filename Enhancement:
Added tweet_id
as a suffix to filenames for better identification.
Thank you! I really appreciate your work! I didn’t expect it to be completed so quickly!
I’ve always known that GIF images on Twitter are published in MP4 format, so personally, I don’t mind that the downloaded format isn’t .gif. As long as I can batch download GIFs from Twitter in their original dimensions, I am very satisfied!
Also, I noticed that the features like “previewing files in advance,” “second confirmation,” and “cancelling during the process” (not only the download cancellation but also during the packing of files into a ZIP file) are now supported! The interface is clean, and the frosted glass effect is very nice!
Moreover, I found that the downloaded files are now automatically named with the format: “Username” + “Tweet Date” + “Specific Time” + “Tweet ID.” It’s fantastic! However, I noticed that the last four digits of the original tweet ID are different from the ones in the downloaded files. I realized this when searching for files. Could you explain why this is? Also, the downloaded ZIP files are named with: “Username” + “User Nickname” + “Total Files Downloaded,” which is great! Simple and clear!
This is a screenshot:
https://imgur.com/a/PBojzHD
(Since the image is too large, deliberately compressing the size would make it unclear, so I’ve uploaded it to Imgur.)
Speaking of which, I had a small “incident” earlier. When I entered my account’s auth_token on the download page and clicked to download, it kept loading, showing “Fetching...” I waited for about 2 minutes, and then a “Check Your Auth Token!” error notification popped up. I initially thought maybe I had entered the wrong auth_token or it hadn’t been updated. But after checking multiple times, everything seemed fine.
Then, I tried deliberately entering a wrong letter, and immediately the “Check Your Auth Token!” error appeared.
When I entered the “correct” token, I had to wait for a while before the error notification popped up, but when I entered the “incorrect” token, the error appeared right away. That made me think the issue might not actually be with the auth_token.
Then I realized I was using a different VPN than the one I usually use, and the node was completely different. So, when I switched back to my usual VPN and node, the script worked normally!
This is why I hate China. Yes, I’m Chinese, but I hate China.
https://imgur.com/a/YpDJO5b
Lastly, may I ask if you have any donation or sponsorship channels that are available for use in China? (Bitcoin and other cryptocurrencies are not acceptable.) I would like to sponsor you!
There was a website in China called "afdian.com" that could be used for this, but it has now been shut down by the Chinese government.
tweet_id
naming.Version 2.1 is now out with the following changes:
tweet_id
.{username}_{date_download}_{total}
.Feel free to try it out! 😊
①
Oh! So it really was a bug. I thought it was intentionally designed that way. 😂 Thank you! 😊
②
I haven’t registered for PayPal, but my father has.
PayPal is legal and can be used in China, but a PayPal account registered in mainland China can only be used for paying for goods, local and cross-border transfers, and other services. Chinese accounts do not support general 'personal transfers' (meaning transfers that are not related to shopping or business).
Only PayPal accounts registered in other countries can fully use the personal local and international transfer features, and they support instant transfers in up to 25 currencies.
Well, it seems there’s nothing more that can be done now. I can only offer my verbal support, Thanks again!!
③
This 'surprise' is too big! I really need this!
Every once in a while, I notice that some accounts I follow get 'banned.' For banned accounts, you can only see the username; you can't view anything else, and it's really hard to know what the account was doing originally, making it difficult to search for them on other platforms.
But now, you can even directly download all the media from banned users! This feature is amazing! It's so incredible! Thank you so much!!🎉😊
Version 2.2 is now available with the following additions:
Feel free to give it a try! 😊
Thank you!😊 I just updated the script, and I noticed that there’s a new “Clear Cache” option on the tab page, which allows me to clear all the cache with one click. However, I found that it doesn't seem to recognize the records of media that I’ve already downloaded and packed into a .zip file.
What I mean is that, after I’ve downloaded all the media from an illustrator's Twitter account, when I perform the same operation again, the script doesn’t notify me that I’ve already downloaded these media. Instead, it starts downloading them all over again. Even though the media I download the second time is exactly the same as the first time, the .zip file that gets generated has a slightly different name.
For example:
① shiej007_20250124_085318_118.zip
② shiej007_20250124_085442_118.zip
I noticed in the update notes for version 2.1 that you mentioned updating the naming format for zip files:
- Modified the ZIP filename format to: {username}_{date_download}_{total}
So, those numbers (085318 and 085442) are just referring to the specific download times, right? That’s why they’re different?
Then, why doesn’t the script notify me that I’ve already downloaded the exact same media when I re-download it? I’ve tried quitting the browser and reopening it, but it doesn’t work. However, I haven’t tried it on my PC yet; I’ve only tested it on my phone. Could it be that this feature is not supported or optimized for mobile devices?
And if you clear the cache or download for the first time (never downloaded before), it will only show the "Download" button. The cache feature works after you perform the initial download.
I intentionally changed the ZIP file naming to include timestamps to avoid duplicates, even if the content is the same. So, you’ll need to check your files. I made this change because of the cache feature. If you don’t like the cache feature, you can downgrade the script to version 2.1 and never update it again.
All the features that work on PC also work on mobile, because the Twitter page is responsive. They don’t need to change their domain to something like m.x.com or m.twitter.com, unlike other websites such as YouTube, which uses m.youtube.com or m.facebook.com
Oh! I understand now, thank you!😊
It was my misunderstanding. I mistakenly thought the functionality works the same way as the Pixiv script I mentioned earlier.
In that script, the operation does not target the user (the "object to be downloaded") by detecting their newly posted content or media. Instead, it tracks the download history of the "script user" (themselves). What I mean is: when the script user downloads works from a specific Pixiv artist they want, the script automatically logs and marks those artworks as downloaded. So, when the script user wants to download more works from that artist later, it will automatically exclude the ones they have already downloaded and instead download any new or previously undownloaded works from that artist.
Therefore, the script is fundamentally not “detecting new media posted by the user (the artist),” but rather it tracks the “download history of the script user.”
For me personally, what I need is the latter.
Nonetheless, I still want to thank you for your work! The current model is also usable! It's just that this model isn’t quite as “perfect” for me.
As for the naming convention of the downloaded zip files, I actually quite like it! Previously, only individual media files displayed their specific download time, but now the zip files do as well, which is very intuitive and makes it easier for later categorization and organization. It’s just that I didn’t see your update log and explanation before, which caused me a bit of confusion when I downloaded the same media file and noticed the filename was different.
I understand your point. Since this script doesn’t perform individual downloads and relies on an API, I can’t add a download history feature for images as you’re requesting, like the script for Pixiv. Essentially, the server is responsible for fetching the original media files and then sending the response via the API.
This script simply sends the username to the server along with the selection of what to download—very straightforward. So, I’m sorry, but I can’t add the feature you’re asking for.
No problem at all! You don't need to apologize! You’re making me feel a bit guilty, you know.😳 This mode is already great, and I’m very satisfied with it. However, the lack of a "download history" feature might be a little inconvenient, as I’ll have to be more careful about it every time I download something. Luckily, each media file has detailed timestamp information, so organizing them later won't be too difficult. Thank you so much!谢谢!☺️👏🎉
Hello, author, it’s me again.:D
This time, I would like to make a feature request. There are a total of 4 items.
Item①: I hope you can add a "semi-custom renaming" system for the files to be downloaded. Specifically, I mean adding a "Settings" function in the Tampermonkey plugin, and then adding a feature called "Renaming" within the "Settings." This should provide several options, such as: "account nickname," "account username," "tweet title," "media source ID of the tweet," "tweet timestamp," "download time." These should be implemented as buttons or toggles. Users can choose which options to enable or disable to determine how they want their downloaded images and videos to be named. (The emphasis is not to allow users to completely rename the files, but to provide several options so each person can choose which ones they want to enable or disable according to their preferences.)
Item②: I hope that when downloading "all media/images/videos," a function is added to "preview in advance" how many files there are to be downloaded. Also, a "double confirmation" button is needed (what I mean is: for example, when the user clicks to download "images," a prompt appears asking: "Are you sure you want to download?" with "Cancel Download" and "Confirm Download" options). Currently, once you click, the download starts immediately and cannot be canceled using conventional methods; the only way to cancel is to exit the webpage. Moreover, some users may have hundreds or thousands of media items, and without the "double confirmation" button or "preview in advance," downloading can be inconvenient. Additionally, a "cancel download" option, which allows users to stop an ongoing download, would be useful.
Item③: I hope that already downloaded media (images and videos) from a specific user can be kept in the browser through cookies or another method, so that users can know which content they have already downloaded. (This might be a little hard to understand, so I need to explain it in more detail. Personally, I frequently use Pixiv and some extensions to download illustrations from artists on Pixiv. Sometimes, I’ve already downloaded all the illustrations of an artist, but they update new ones later, or an artist changes their username, nickname, and avatar, causing me to download everything again. I’ve found a great script that solves these problems perfectly for Pixiv. But currently, there is no such functionality for Twitter. I basically use Twitter the same way I use Pixiv, so I hope Twitter could have this feature too. At present, I haven’t found any Twitter downloader script that can do this.)
Item④: I hope that GIF images can be supported for download. (I just tested, and your script currently does not support batch downloading original size GIF images. I hope this will be supported in the future.)
Lastly, no matter what, I would like to thank you for your hard work and efforts! I am very grateful!!