JimmXinu / FanFicFare

FanFicFare is a tool for making eBooks from stories on fanfiction and other web sites.
Other
754 stars 161 forks source link

wuxiaworld.com #143

Closed jschpp closed 7 years ago

jschpp commented 7 years ago

Hi could you add support for wuxiaworld? I'm not quite sure how to go about adding it myself. I know, that it's not fanfiction per se but it would be interesting to add.

JimmXinu commented 7 years ago

I'm personally not adding new sites these days unless there's wide spread interest, or it's something I want to read myself.

But I'll leave this issue open for a while in case any other developers are interested in doing it.

jschpp commented 7 years ago

I tried writing an adapter but I stumbled apon a few hindrances.

  1. I had no idea how to contribute - solved that by copying another adapter and modifying it (work in progress
  2. Python2's datetime method can AFAIK not parse ISO 8601 (RFC3339) dates correctly. There exists a library https://pypi.python.org/pypi/pyRFC3339 but I'm not sure about importing it.

The problem in 2. is that the format YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00) can't be parsed correctly because of the last part +01:00 pythons strptime can only work with +0100 note the missing colon.

Should I manually write a parse funtion or import pyrfc3339? Alternatively I could ignore the timezone completely.

JimmXinu commented 7 years ago

The problem with importing other packages is that FanFicFare has three versions -- the (pip installed) CLI, the Google Cloud web service and the Calibre plugin. Only the CLI can require additional packages; the CLI and plugin must carry their own copies of packages they want if not already present in the environment.

This, plus the fact Python's built-in datetime libraries expect parsed dates to match the local machine's locale, means there's already a lot of code included to work around datetime issues. Take a look at what makeDate does with month abbrev names and AM/PM for example.

So I'm not inclined to add new libraries if it can be avoided.

Short answer: Manually write a parse function--unless it's crazy difficult, then we could talk about it more.

I'm glad to see you're trying to do this, thanks!

gcomyn commented 7 years ago

Have you had any progress on this? or would you like some help? I can take a look at it an create an adapter for it, if you wish.

JimmXinu commented 7 years ago

Support added by @gcomyn