Giter VIP home page Giter VIP logo

plutoalert's People

Contributors

drandreaskrueger avatar

Stargazers

 avatar

Watchers

 avatar

plutoalert's Issues

infer the future from the past - store results in a database

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.

--episodes s02e08,s03e09 = filter for specific episodes

Idea for the next steps:

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.

Purpose

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

requests.get(url, proxies=proxies) to circumvent PlutoTv geoblocking

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.

good first issue

There are two levels to this "good first issue":

  • simply: hardcode a couple of proxy server:port addresses in a proxylist.txt file that is read in when needed
  • advanced: parse the http://free-proxy.cz page for an uptodate proxy in an unblocked country, here is an example

get rid of all external libraries, e.g. `pip install requests`

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

good first issue

This is a good first issue, because you can always compare the "before and after", and it's rather easy.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.