bitbybyte / fantiadl

Download posts and media from Fantia
MIT License
303 stars 51 forks source link

Mass post downloading not working #96

Closed jli94 closed 2 years ago

jli94 commented 2 years ago

Happens when going https://fantia.jp/fanclubs/[clubhere]/posts, but individual posts it works fine.

Downloading fanclub [club id here]... Collecting fanclub posts... Encountered an error downloading URL. Skipping... Traceback (most recent call last): File "D:\roar of the abyss\dl\fantiadl-master\fantiadl.py", line 109, in downloader.download_fanclub(fanclub, cmdl_opts.limit) File "D:\roar of the abyss\dl\fantiadl-master\models.py", line 206, in download_fanclub post_ids = self.fetch_fanclub_posts(fanclub) File "D:\roar of the abyss\dl\fantiadl-master\models.py", line 282, in fetch_fanclub_posts parsed_date = dt.strptime(date_string, "%Y-%m-%d %H:%M") File "C:\Users\red\AppData\Local\Programs\Python\Python38-32\lib_strptime.py", line 568, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) File "C:\Users\red\AppData\Local\Programs\Python\Python38-32\lib_strptime.py", line 352, in _strptime raise ValueError("unconverted data remains: %s" % ValueError: unconverted data remains: Update

ToBowlRu commented 2 years ago

Quick fix is going into model.py and after line 281 date_string = post.select_one("span.post-date").text.rstrip(RENEW_STR) but before parsed_date = dt.strptime(date_string, "%Y-%m-%d %H:%M") Add the following: date_string = date_string.replace("Update", "")

So lines 281-283 should look like this (I never use github so I don't know how to format this): date_string = post.select_one("span.post-date").text.rstrip(RENEW_STR) date_string = date_string.replace("Update", "") parsed_date = dt.strptime(date_string, "%Y-%m-%d %H:%M")

jli94 commented 2 years ago

Worked perfectly! Thanks.

bitbybyte commented 2 years ago

That's insufficient because Fantia has language options now.