Giter VIP home page Giter VIP logo

Comments (13)

kettenbach-it avatar kettenbach-it commented on August 12, 2024 2

The account works. I use it with Kodi on my FireTV-Stick all the time and if I leave out the getinfo() the account works with stb-prox as well.

Your code is no bad at all. It's readable, reasonable short and and it works.
And I like, that you decided to go with a framework (fastapi), though I would have taken just a plain simple Flask since you don't need to build your own api. Just implement one. But it's good as it is.
But: I can see from the structure of your program that you are not a professional.

If you want I can help you improve (I'm a python professional).
If you'd like, I'll submit Pull-Reuqests with the fixes and enhancements that I make.

The problem that I have:
the portal above is the only account I have
Different portals seem to behave a little different
It's impossible for me to test.
I'd fix the 404 thing which I described above, but it may brake other portals

So we have to communicate and test each others code.
If we had accounts on several portals, we could do that automatically using unit-tests.

What do you think?

from stb-proxy.

rockydares avatar rockydares commented on August 12, 2024 2

I think it's a great idea. I can help with multiple portal credentials for the test.

from stb-proxy.

rockydares avatar rockydares commented on August 12, 2024 1

Hi @kettenbach-it, I've sent you an email with working credentials.

from stb-proxy.

kettenbach-it avatar kettenbach-it commented on August 12, 2024

Okay, this portal returns a 404 for the request in getinfo()
Question is: what is getinfo() good for anyway?
The data requested in getinfo() is never used.
The same applies for getprofile() btw.

After ignoring the 404 of getinfo(), that portal works.

from stb-proxy.

Chris230291 avatar Chris230291 commented on August 12, 2024

In my testing getting a token doesn't mean the account works, neither does getting a valid profile.
A lot of accounts that do work need the get profile request before it will return a playlist and let you play channels.
I'm not a expert on this. I just put this proxy together because I couldn't get others to work.
I'm also not a "real" programmer. I just know a little python.

from stb-proxy.

Chris230291 avatar Chris230291 commented on August 12, 2024

If you are sure the account works, but fails the profile and info requests, I could make the app not fail if those requests fail.

from stb-proxy.

kettenbach-it avatar kettenbach-it commented on August 12, 2024

@rockydares Oh, this is really good

Suggestion: I'll dig into the code a little deeper and I'll write a fully automated test suite, that will test the code and all its future changes to comply with all portal urls that we have.

from stb-proxy.

Chris230291 avatar Chris230291 commented on August 12, 2024

Thats no problem help is welcome.

I have a couple other projects where I have used flask. I read that fastapi was much faster so I decided to try it for this and it does seem really fast.

I was using get info as the final test to see if the portal is working. Instead we could get the token then get the profile (unconditionally) and then see if we can get the playlist. If we get the playlist then we can assume the account is good. Without testing your credentials for myself it seems that would fix your issues without breaking how it currently works.

EDIT: we don't actually need to test accounts... that's just something I thought would be nice.

from stb-proxy.

kettenbach-it avatar kettenbach-it commented on August 12, 2024

I was using get info as the final test to see if the portal is working. Instead we could get the token then get the profile (unconditionally) and then see if we can get the playlist. If we get the playlist then we can assume the account is good. Without testing your credentials for myself it seems that would fix your issues without breaking how it currently works.

Either that, or we specify in a configuration parameter what type the portal is and implement the appropriate login scheme for each portal. I will check on that soon.

@rockydares Can you send me the portal accesses? Preferably by private mail. In my Github profile you will find my website and on the website an email address - if need with GPG Key.
I promise not to misuse it.
I will pass the portal accesses to the tests in an environment variable so that the accesses do not appear in the code.
We can also store them as a secret variable in the Github CI/CD.

from stb-proxy.

kettenbach-it avatar kettenbach-it commented on August 12, 2024

@rockydares Got them! I'll write some tests during the week if I find some spare time during the day

from stb-proxy.

kettenbach-it avatar kettenbach-it commented on August 12, 2024

@rockydares I started working on the tests. Are you sure these portals are working!?

from stb-proxy.

rockydares avatar rockydares commented on August 12, 2024

Those were working when I gave you. I tested personally. But if any of those not working now, I can send fresh credentials with more portals.

from stb-proxy.

kettenbach-it avatar kettenbach-it commented on August 12, 2024

How long will these credentials be valid?

In case you don't know the CI/CD mechanism yet:
With CI/CD (for Continuous Integration / Continuous Delivery), the tests stored in the code are automatically executed on the Github server with every commit of new code and only if all tests ran correctly - i.e. if the new code still connects correctly to the stored portals - is the Pull-Request released for the merge.

For our case, this would be very useful to make sure over time that all types of portals still work.
The credentials for portals are stored in a secret area of Github so that only the owner of the project can see them.
When the credentials lose their validity, they need to be renewed.
If this is often the case, the whole mechanism makes no sense.

from stb-proxy.

Related Issues (20)

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.