Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xtream Updates and added settings #276

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

superolmo
Copy link
Contributor

@superolmo superolmo commented May 5, 2023

@superolmo
Copy link
Contributor Author

@mtwebster I reopened a new PR with the same content as in PR #273 to clean up my commit history

@mtwebster
Copy link
Member

I noticed I can get a free trial: https://xtreamnet-iptv.com/product-detail/xtream-iptv-12h-trial

Do you know which type of device I should select? It gives me a choice of M3U among others.

@superolmo
Copy link
Contributor Author

The interface is not intuitive. I would guess M3U first, second could be Activate Codes.
I have asked users that opened issues reports related to Xtream API to test the PR, but so far no answers.

@mozotech
Copy link

mozotech commented May 9, 2023

@superolmo Thought I'd mention this reasonably current library I came across in case you've not already seen it. Looks nicely structured and may offer some insight into the xstream codes api. (I found it when trying to understand what the xstream codes api was - now I know a little bit more but not enough to help just yet).
https://github.com/tellytv/go.xtream-codes.git

@superolmo
Copy link
Contributor Author

Thanks @mozotech. Unfortunately, each provider slightly modified the API to suit their needs. That is why you have some implementations that works for some providers but not others. Then you have the problem that the providers themselves completely skip fields. Nevertheless, looking at someone else implementation might trigger some new ideas.

@mtwebster
Copy link
Member

Ok.. I got it working at first - some observations/issues:

  • I think the 4 second timeout may be a bit too short. Logging in failed at first, timing out, then trying again it worked. Maybe 10 seconds might be more reasonable?
  • Once it loaded all the metadata, the streams worked, I could view channels, etc...
  • Changing preferences should somehow prompt or automatically reload the channels.
  • After changing preferences then opening the xtream config and closing, I was refused connection.
  • Restarting hypnotix, crashes with an X server error.
  • Removed the provider from gsettings, re-add xtream, crashing still.

The root cause of the crashes are not this PR, though it seems to be exposing the issue.

In Gtk programs, all gui-related Gtk calls must be done in the main thread.

In hypnotix.py, any functions decorated with @async_function are running on a separate thread, and there's a lot of gui interaction occurring, any of which could trigger the error. The fact that there are so many xtream channels is triggering this more.

Did you get any crashes like this during testing?

I'll see if I can de-tangle this later when I get a chance.

@mtwebster
Copy link
Member

Ok I made a PR on this PR which avoids any gtk calls inside of worker threads. I think the main issue was due to changing the cursor type during reloading - hopefully I didn't break anything, I'm not super familiar with this app.

My adjusted observations after fixing all that:

  • Startup works fine loading the xtream information, but any attempt to reload (either ctrl-R or editing then closing the stream info) results in a failed authentication with xtream. Maybe some new 'token' or whatever needs to be created for logging in? I'm not really sure, I'm pretty weak in that department.
  • As for refreshing when preferences change, we could trigger a reload when the user backs out of the preferences page. That would keep multiple refreshes happening at the same time if it's triggered by individual preference changes.

@mtwebster
Copy link
Member

I managed to get a 12-hour test account also so I could try having multiple xtream accounts, but I have the same issue as reloading - failed authentication.

The first account loads fine, then the 2nd one fails. Trying to reload, they both end up failing.

This allows multiple xtream accounts to be added, and fixes the
issue of not being able to refresh channels.

Add a reference to the correct Xtream instance to the Serie class,
as it's referenced in show_episodes().
@mtwebster
Copy link
Member

mtwebster commented May 10, 2023

Ok the issue was that Xtream.state was class-wide, not instance, so authentication was never being attempted past the initial one.

I added another commit to my PR to make multiple accounts work properly.
superolmo#4

@superolmo
Copy link
Contributor Author

Awesome @mtwebster ! Let me tested on my hand and push to this PR.

Change the use of idle/threaded functions a bit to avoid x errors.
@mtwebster
Copy link
Member

I can't use my account any more, but I think the only remaining issue was refreshing when leaving preferences if any were changed (like parental control).

@clefebvre clefebvre changed the title Xtream Updates and added settings [WIP] Xtream Updates and added settings Jun 5, 2023
@karim-selih
Copy link

karim-selih commented Apr 22, 2024

@superolmo I can confirm that this PR fixes issues I was having with the current version. The fix for me was missing headers when authenticating, which I had fixed locally before finding this PR.

@1b0u
Copy link

1b0u commented Jul 25, 2024

why you dont merge this pr? i tested it, it fix/enhance a lot of things
even if it's not perfect, i would like to have these fix in release and stop applying your changes manually each time there is a release...

@superolmo superolmo changed the title [WIP] Xtream Updates and added settings Xtream Updates and added settings Aug 4, 2024
@superolmo
Copy link
Contributor Author

@1b0u I am not allowed to merge this PR. It requires someone who has the access rights to do so.

@Aqua-014
Copy link

Aqua-014 commented Oct 9, 2024

@mtwebster please merge this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants