kemayo / leech

Turn a story on certain websites into an ebook for convenient reading
MIT License
154 stars 24 forks source link

Stories from Reddit #71

Closed ClaasJG closed 2 years ago

ClaasJG commented 3 years ago

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 and client_secret.

(This is not really an issue, but I thought it may be of interest)

-ClaasJG