Spark-NF / twitter_media_downloader

Twitter media downloader.
Apache License 2.0
293 stars 52 forks source link

Error in the printing of the posting date. #24

Open Alexo88 opened 3 years ago

Alexo88 commented 3 years ago

Hello, I appreciate the program, it works well. Notice an error I don't know if it's mine.

twitter_media_downloader.py -f "% date%% tweet_id%% filename%.% ext%" -s orig -u usernn2021 --since 2020-12-1 --until 2022-1-1

result: 2021-04-08 0000794600008343943 eokxlkuvkae-tho 2021-04-08 00000000000 xxx 2021-04-08 000000000000xxxx 2021-04-08 00000000000xxx same In my command I pretend that each file, the data in which it was posted is printed, but it only prints the day it started to download, do you know why that happens? What did I do wrong? or does it work like that?

Spark-NF commented 2 years ago

Could it be that you're downloading retweets that have been posted on the same day? If so, make sure to use %original_date% instead.

If not, can you share such a tweet here so I can investigate?

Spark-NF commented 2 years ago

Are you in Windows and using cmd/powershell?

It's possible that your shell is replacing %date% by the environment variable DATE, which contains the current date in your locale's format.

Make sure the % is escaped properly in that case. It might be hard in CMD, but you can do something like:

python twitter_media_downloader.py -o out -f "test %date% %filename%.%ext%" -u Twitter

Becomes (note the quotes around the percent):

python twitter_media_downloader.py -o out -f "test "%"date"%" %filename%.%ext%" -u Twitter