kemayo / leech

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

Detect loop when using 'next_selector' #58

Closed ClaasJG closed 3 years ago

ClaasJG commented 3 years ago

Good evening.

Using the 'next_selector' I came across a scenario where the last chapter had a reflexiv 'next link'. Processing this Leech currently just starts looping endlessly. This pull request adds a simple loop detection and assumes there are no more chapters, when a chapter link appears a second time.

When a work around for such a case does already exist (i.e. with a more fancy next selector?) it should probably be documented.

I hope its ok, that I presented this with a pull request and not an issue. Have a nice day.

-ClaasJG

kemayo commented 3 years ago

I am all for people contributing pull requests, never fear.