twitter-photos icon indicating copy to clipboard operation
twitter-photos copied to clipboard

Cannot filter retweets

Open faeinthebay opened this issue 7 years ago • 5 comments

Although the Python twitter API supports filtering out retweets, it is not currently possible to filter them in this utility. I suspect users (including myself) use the user argument to download photos posted by twitter users and might not care about retweeted photos that are not originally theirs.

faeinthebay avatar Mar 04 '17 08:03 faeinthebay

I have fixed this on my own branch, but it has slightly deviated from the original codebase, so it cannot be easily merged. Fortunately the changed are simple to replicate, here is the relevant commit: https://github.com/andrewia/twitter-photos/commit/653cebee7bdd89c9774d32fe31c44b53c802a156

I missed some documentation which I fixed in another commit. I apologize for not offering a clean pull request, I'm still learning Git and good practices. Thanks for your time!

faeinthebay avatar Mar 04 '17 09:03 faeinthebay

I should also note that I have conducted basic tests on my fork and have found no issues including and excluding retweets.

faeinthebay avatar Mar 04 '17 09:03 faeinthebay

i get an error after using the filter retweet option "unrecognized arguments: -w". I did editing the codes correctly from what you provided, so what did it go wrong in my case?

arcantuba avatar Aug 10 '19 09:08 arcantuba

I have fixed this on my own branch, but it has slightly deviated from the original codebase, so it cannot be easily merged. Fortunately the changed are simple to replicate, here is the relevant commit: andrew-ledawson@653cebe

I missed some documentation which I fixed in another commit. I apologize for not offering a clean pull request, I'm still learning Git and good practices. Thanks for your time!

Thank you so much Andrew. I came across twphotos and was so happy to be able to mirror entire accounts, but upon discovering retweets were being saved as well, it was a huge disappointment, as some twitter accounts contain more retweets than original posts, and thus the original downloads of said account were tainted by random other images from other accounts.

I've successfully merged your code and tested it, and it's working great. Thank you so much for the contribution!

I've went so far as to make a batch script that reads a txt file that lists a username on each new line, which it parses and runs the command per username. (along with twitter-dl to snatch video posts.) A function like this would be great is to be able to do this without having to close and restart the connection to twitter (thus hitting the twitter api limitation as quickly.) Although that's well out of my coding experience with Python, so I just parse 30-40 accounts to each txt file when updating, as the API resets every 15 minutes.

quentinwolf avatar Jan 29 '20 22:01 quentinwolf

I also get the same error when attempting to use the retweet filter option: usage: twphotos [options] twphotos: error: unrecognized arguments: -w

egodenovo avatar Jul 24 '20 19:07 egodenovo