It is not possible to extract the link form the first episode button, because the button is only generated once the page is rendered by the browser. Therefore it was put together using the category link. As far as possible we should avoid relying on selenium as it's quite slow; the ideal situation is that we can eventually remove selenium from the code again.
The implemented workaround here is to simply try variations of the link. If a 404 page is encountered, the current strategy is to convert anything of the form 2nd-season, 6th-season or 23rd-season into it's corresponding season-x version. This perfectly addresses the example from issue #4.
The workaround may seem like overkill but I tried to make it such that we can easily add new variations, by adding and elif statement before the else which would raise the error in case none of the attempts can be performed.
It is not possible to extract the link form the first episode button, because the button is only generated once the page is rendered by the browser. Therefore it was put together using the category link. As far as possible we should avoid relying on selenium as it's quite slow; the ideal situation is that we can eventually remove selenium from the code again.
The implemented workaround here is to simply try variations of the link. If a 404 page is encountered, the current strategy is to convert anything of the form 2nd-season, 6th-season or 23rd-season into it's corresponding season-x version. This perfectly addresses the example from issue #4.
The workaround may seem like overkill but I tried to make it such that we can easily add new variations, by adding and
elif
statement before theelse
which would raise the error in case none of the attempts can be performed.