drandreaskrueger / plutoalert Goto Github PK
View Code? Open in Web Editor NEWalert when a certain programme begins on pluto.tv
License: The Unlicense
alert when a certain programme begins on pluto.tv
License: The Unlicense
replace the (external, pypi) comfortable
import requests
by (internal, needs no extra pip installation) the more tedious
import urllib, json
to fetch the PlutoTv API call URL, and parse the contained json.
See e.g. urllib manual and json manual, and perhaps even the requests sourcecode because that builds on top of internal libraries.
Intention: Then the code runs easier in any environment where install from pypi is difficult or impossible.
Perhaps it could be run even in places like this: https://reqbin.com/code/python
This is a good first issue, because you can always compare the "before and after", and it's rather easy.
select specific episodes:
--e s02e08,s03e09
--episodes s02e08,s03e09
stay completely silent if there is no hit:
-o
--only
then this example:
python -m plutoalert Search -o --episodes s02e08,s03e09 -s star-trek-discovery-de,star-trek-discovery-ptv1
I could put into my bash login, or repeat every 6 hours, or hook up to a cronjob that sends me an email if the answer is non-empty, etc.
That (almost always silent) script could be run in the background, and just let me live my life for weeks ... until suddenly PlutoTv is providing the next unseen episode ...
... then finally, the name of this repo makes sense: plutoalert
If geoblocking results in an empty answer [], then retry the call but with proxies:
requests.get(url, proxies=proxies)
Instructions are here and here.
I first wanted to get this working on the commandline, but couldn't yet:
curl -x http://107.173.222.196:49818 http://api.pluto.tv/v2/channels
curl -x http://107.173.222.196:49818 -L http://api.pluto.tv/v2/channels
curl: (7) Failed to connect to 107.173.222.196 port 49818: Connection timed out
curl: (56) Recv failure: Connection reset by peer
where I took the proxy IP and port from http://free-proxy.cz in one of the countries mentioned in the geoblocking paragraph.
There are two levels to this "good first issue":
Is your feature request related to a problem? Please describe.
The main problem on pluto.tv is the extreme limitation of the EPG - we can hardly see half a day into the future.
Describe the solution you'd like
Not really a "solution", but if we had knowledge about a longer timespan in the past then we can infer the shape of their rotation.
And then our educated guesses can help us a little bit, for what to expect in the future.
Describe alternatives you've considered
The idea is to ... feed the results of every call, every search, every filtering into a database.
Either just the filtered subselection - or as a brute force approach, the whole API answer.
Beginning, it could simply be a flat file. E.g. columns 2,3,4 are always time,month,day - so that stays readable later.
Additional context
Beware that every API answer consists of approx 3000 episodes. It might be better to just store the results AFTER the filtering.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.