L4cache / kemono-dl

(personal fork of) A simple kemono.party downloader using python.
95 stars 14 forks source link

Datebefore Dateafter time format change #23

Closed anon567321 closed 1 year ago

anon567321 commented 1 year ago

in args.py you need to change this line

Current 306 args[key] = datetime.datetime.strptime(args[key], r'%Y%m%d') New 306 args[key] = datetime.datetime.fromisoformat(args[key])

The date format in datebefore/dateafter functions should now be YYYY-MM-DD, not YYYYMMDD.

L4cache commented 1 year ago

This is the format for parsing args, not related to the api returned value change.

L4cache commented 1 year ago

Please provide more info if you actually encountered problem.

anon567321 commented 1 year ago

When I used the function "--user-updated-dateafter 20231021", I got the error "20231021 is an invalid date | correct format: YYYYMMDD". But after replacing line 306, and using the function "--user-updated-dateafter 2023-10-21", everything works properly

L4cache commented 1 year ago

When I used the function "--user-updated-dateafter 20231021", I got the error "20231021 is an invalid date | correct format: YYYYMMDD". But after replacing line 306, and using the function "--user-updated-dateafter 2023-10-21", everything works properly

Can't reproduce.

anon567321 commented 1 year ago

try "--dateafter 2023-09-26"

L4cache commented 1 year ago

I really can't reproduce unless you provide specific links.

ghost commented 1 year ago

Hello, I'm having the same issue.

INFO:Downloading posts from kemono.su | patreon | Spageta | 68982275 ERROR:Unable to get posts for https://kemono.su/patreon/user/68982275 Traceback (most recent call last): File "/media/user/Garden/kemono-dl-main/src/main.py", line 834, in start_download self.get_post(url) File "/media/user/Garden/kemono-dl-main/src/main.py", line 201, in get_post if self.skip_post(post,False): File "/media/user/Garden/kemono-dl-main/src/main.py", line 672, in skip_post elif check_date(self.get_date_by_type(post['post_variables']['published' if not self.fp_added else 'added']), self.date, self.datebefore, self.dateafter): File "/media/user/Garden/kemono-dl-main/src/main.py", line 843, in get_date_by_type t = datetime.datetime.fromisoformat(time) ValueError: Invalid isoformat string: '20231013'

Thank you for your help!

L4cache commented 1 year ago

Hello, I'm having the same issue.

INFO:Downloading posts from kemono.su | patreon | Spageta | 68982275 ERROR:Unable to get posts for https://kemono.su/patreon/user/68982275 Traceback (most recent call last): File "/media/user/Garden/kemono-dl-main/src/main.py", line 834, in start_download self.get_post(url) File "/media/user/Garden/kemono-dl-main/src/main.py", line 201, in get_post if self.skip_post(post,False): File "/media/user/Garden/kemono-dl-main/src/main.py", line 672, in skip_post elif check_date(self.get_date_by_type(post['post_variables']['published' if not self.fp_added else 'added']), self.date, self.datebefore, self.dateafter): File "/media/user/Garden/kemono-dl-main/src/main.py", line 843, in get_date_by_type t = datetime.datetime.fromisoformat(time) ValueError: Invalid isoformat string: '20231013'

Thank you for your help!

Have you tried latest changes?

ghost commented 1 year ago

Thank you!

L4cache commented 1 year ago

The issue of OP is different from the addressed issue above, I guess. Please provide more info.

anon567321 commented 1 year ago

I've already fixed it myself. Actually, I'm using this fork: https://github.com/ovear/kemono-dl As I understand it, it is no longer active, and your fork is the most actual one now. Since the part of the code responsible for the date was the same in his and yours code, I thought that your fork would have the same problem.