There are a lot of stories published on reddit, and because its reddit its quite easy to ask an author if you are allowed to download his work as an epub.
it is probably infeasible to write a generic site handler, which handles reddit because it is basically free text and authors may structure there multipart stories however they want.
Most likely:
a first / previous / next link at the top or bottom of a part
a part x-1 / part x+1 link at the top or bottom for a part x
a first / previous / next link in an top level comment
a part x-1 / part x+1 link at in an top level comment
no links, the story has a prefix and you have to find it from the users submissions
next part as comment below the part before
a wild mix of all those
While it is probably infeasible to write a generic one, I hacked together a side handler, which mostly handles the first 5 cases.
I do not propose to clean it up and merge it, because its just a lot of guess work, but I thought I share it nerveless.
It works for the stories I intended it to work, feel free to tell me about stories it does not work for and I will try to somehow patch it :shrug:
There are a lot of stories published on reddit, and because its reddit its quite easy to ask an author if you are allowed to download his work as an epub.
it is probably infeasible to write a generic site handler, which handles reddit because it is basically free text and authors may structure there multipart stories however they want.
Most likely:
While it is probably infeasible to write a generic one, I hacked together a side handler, which mostly handles the first 5 cases. I do not propose to clean it up and merge it, because its just a lot of guess work, but I thought I share it nerveless. It works for the stories I intended it to work, feel free to tell me about stories it does not work for and I will try to somehow patch it :shrug:
Hacky Reddit Site handler: https://gist.github.com/ClaasJG/e5b9d536f7acfea928fa575d84d81f1b
You have to add praw to your toml file and create an app at https://ssl.reddit.com/prefs/apps/ to aquire a
client_id
andclient_secret
.(This is not really an issue, but I thought it may be of interest)
-ClaasJG