bvanheu / pytoutv

TOU.TV client library and user interfaces written in Python 3
96 stars 23 forks source link

Flag premium only shows with toutv list #133

Closed ldeseynes closed 5 years ago

ldeseynes commented 5 years ago

Hi guys,

Is it possible to list - and download - shows that are not premium only?

Thanks in advance!

simark commented 5 years ago

There is likely a flag in the data we receive that indicates this. Would you be able to take a look?

ldeseynes commented 5 years ago

What data are you talking about exactly? When I get the list of available shows via toutv list there is no flag for only premium ones. So if I try to fetch an episode of a show that happens to be available for premium only, or just get info about it, I get this exception:

Unknown exception: <class 'RuntimeError'>: Le contenu sélectionné est disponible seulement en premium

simark commented 5 years ago

When you do toutv list, the program gets the list of shows in JSON format from the tou.tv servers. We then print that list nicely for the user. The raw data we get from the server contains much more info that what we print.

If you are ready to take a peek in the tou.tv source code, I can point you to the right area, and you can try to figure out if the information you are looking for (whether a show is premium only) is presentin the data we receive. I ask this because while I don't have time right now to do this myself, I would be happy to help somebody who wants to learn.

PS: On peut également parler français, si tu veux.

ldeseynes commented 5 years ago

Haha thanks but I like it better in english so that it can be useful for someone else.

I think I found the information in the source code via the "extra-episode" flag but if you have an easier way your help is very welcome.

simark commented 5 years ago

That sounds right.