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

Add XTream API #148

Merged
merged 25 commits into from
Nov 23, 2021
Merged

Add XTream API #148

merged 25 commits into from
Nov 23, 2021

Conversation

superolmo
Copy link
Contributor

@superolmo superolmo commented Jun 6, 2021

This MR is for supporting Providers with XTream API. I have added a file called xtream.py, but I also added the same file to pypi.org under the name pyxtream. Code will try to load pyxtream, if not available it will use the local file. I will the maintainers of this repo decide whichever way they want to handle it.
I added the suggestion specified in #91 and it should take care or #48 and #116 as well. This does not handle M3U.

@superolmo
Copy link
Contributor Author

superolmo commented Jun 6, 2021

Forgot to mention, I updated all the absolute paths to relative. It made it easier for me to test the software without installing. And also I changed the flag filename from Kowait.png to Kuwait.png.

@superolmo
Copy link
Contributor Author

Rebased to version 1.7

@clefebvre clefebvre changed the title Added XTream API [NEXT] Added XTream API Jun 7, 2021
@milomak
Copy link

milomak commented Jun 13, 2021

will cloning the repo now include the ability to use xtream api codes?

@superolmo
Copy link
Contributor Author

@milomak please follow the below commands. Probably there is a faster/better way, but for now it works.

git clone [email protected]:linuxmint/hypnotix.git
git fetch origin pull/148/head:hypnotix/master
git checkout hypnotix/master

For my testing I run from the repo root the command:

python3 usr/lib/hypnotix/hypnotix.py

@milomak
Copy link

milomak commented Jun 16, 2021 via email

@superolmo
Copy link
Contributor Author

@milomak Please open a New Issue. This is just a problem with your git setup, see Cloning with SSH URLs

@milomak
Copy link

milomak commented Jun 16, 2021

tried adding an iptv account that uses xtream codes api. the below were the results

$ python3 usr/lib/hypnotix/hypnotix.py

Loading providers...
XTREAM Loading Channels
Loaded 47 Live Groups in 0.588 seconds
Loaded 5289 Live Streams in 2.649 seconds
'is_adult'
Traceback (most recent call last):
  File "/home/milomak/hypnotix/usr/lib/hypnotix/hypnotix.py", line 1289, in reload
    self.x.load_iptv()
  File "/home/milomak/hypnotix/usr/lib/hypnotix/xtream.py", line 538, in load_iptv
    new_channel = Channel(
  File "/home/milomak/hypnotix/usr/lib/hypnotix/xtream.py", line 82, in __init__
    self.is_adult = stream_info['is_adult']
KeyError: 'is_adult'
Couldn't parse provider info:  IPTV:::xtream:::http:https://iptvlink:2082/:::milomak:::password:::
Loading providers...
XTREAM Loading Channels
Loaded 47 Live Groups in 0.000 seconds
Loaded 5289 Live Streams in 0.000 seconds
'is_adult'
Traceback (most recent call last):
  File "/home/milomak/hypnotix/usr/lib/hypnotix/hypnotix.py", line 1289, in reload
    self.x.load_iptv()
  File "/home/milomak/hypnotix/usr/lib/hypnotix/xtream.py", line 538, in load_iptv
    new_channel = Channel(
  File "/home/milomak/hypnotix/usr/lib/hypnotix/xtream.py", line 82, in __init__
    self.is_adult = stream_info['is_adult']
KeyError: 'is_adult'
Couldn't parse provider info:  IPTV:::xtream:::http:https://iptvlink:2082/:::milomak:::password:::

i am running debian sid so i suspect that plays a part of the issue

@milomak
Copy link

milomak commented Jun 16, 2021

oaajgpjnedpempjm

this is what i see after waiting more than 10 minutes

@superolmo
Copy link
Contributor Author

tried adding an iptv account that uses xtream codes api. the below were the results

$ python3 usr/lib/hypnotix/hypnotix.py

Loading providers...
XTREAM Loading Channels
Loaded 47 Live Groups in 0.588 seconds
Loaded 5289 Live Streams in 2.649 seconds
'is_adult'
Traceback (most recent call last):
  File "/home/milomak/hypnotix/usr/lib/hypnotix/hypnotix.py", line 1289, in reload
    self.x.load_iptv()
  File "/home/milomak/hypnotix/usr/lib/hypnotix/xtream.py", line 538, in load_iptv
    new_channel = Channel(
  File "/home/milomak/hypnotix/usr/lib/hypnotix/xtream.py", line 82, in __init__
    self.is_adult = stream_info['is_adult']
KeyError: 'is_adult'
Couldn't parse provider info:  IPTV:::xtream:::http:https://iptvlink:2082/:::milomak:::password:::
Loading providers...
XTREAM Loading Channels
Loaded 47 Live Groups in 0.000 seconds
Loaded 5289 Live Streams in 0.000 seconds
'is_adult'
Traceback (most recent call last):
  File "/home/milomak/hypnotix/usr/lib/hypnotix/hypnotix.py", line 1289, in reload
    self.x.load_iptv()
  File "/home/milomak/hypnotix/usr/lib/hypnotix/xtream.py", line 538, in load_iptv
    new_channel = Channel(
  File "/home/milomak/hypnotix/usr/lib/hypnotix/xtream.py", line 82, in __init__
    self.is_adult = stream_info['is_adult']
KeyError: 'is_adult'
Couldn't parse provider info:  IPTV:::xtream:::http:https://iptvlink:2082/:::milomak:::password:::

i am running debian sid so i suspect that plays a part of the issue

Oh, somehow I knew it. Every xtream implementation has different fields. Your particular implementation does not have the key "is_adult". I am not sure how many more are not defined, but there are few that must be there to work with Hypnotix software.
I see from the error message that the first 2 files (Live Groups and Live Streams) have been saved under ~/.hypnotix/providers/IPTV-all_streams_Live.json and ~/.hypnotix/providers/IPTV-all_groups_Live.json. Please look for those files and send me a sample of it.

@milomak
Copy link

milomak commented Jun 17, 2021

those files don't exist

~$ sudo updatedb
[sudo] password for root:
~$ locate IPTV-all_streams_Live.json
~$ locate IPTV-all_groups_Live.json
~$

@superolmo
Copy link
Contributor Author

@milomak Please pull again from repo and test the new changes.

@milomak
Copy link

milomak commented Jun 18, 2021

great stuff. working now.

@milomak
Copy link

milomak commented Jun 18, 2021

one thing i noticed is that it picks up the different categories, but has all the channels in every individual category

@superolmo
Copy link
Contributor Author

I realized the same thing, and it should be fixed now.

@milomak
Copy link

milomak commented Jun 18, 2021

wonderful work. working like a charm.

@milomak
Copy link

milomak commented Jun 19, 2021

this work is so great. the other alternative is smarters which is some distance behind in understanding how a desktop app works.

i am so appreciative of your efforts.

@superolmo
Copy link
Contributor Author

superolmo commented Jul 25, 2021

Not sure what you want to do. This thread is about handling the xtream API in Hypnotix. We don't reverse engineer apps to figure out the source of the video.

@rht125
Copy link

rht125 commented Jul 26, 2021

There are more than 600+ TV channels in India. Hypnotix have only those channels which are already available on youtube.
Like USA have multiple feeds in your software, there is a need of multiple feed from India.

@superolmo
Copy link
Contributor Author

@rht125 Please open an issue at https://github.com/Free-TV/IPTV

@clefebvre clefebvre changed the title [NEXT] Added XTream API Add XTream API Jul 28, 2021
@clefebvre
Copy link
Member

Hi @superolmo, thanks for this PR, I'm interested in adding support for Xtream API. As it is in master there's no real support, we just mimick M3U through it really.

That said I can't merge your PR, it contains too many unrelated changes.

Here is my feedback:

  • pypi shouldn't be involved. If upstream changes occur we can rebase/update the xtream.py hosted here.
  • I'm not interested in the relative path. If anything we could use a prefix at build level, but it's not related to Xtream anyway.
  • The flag change looks good but is not related to Xtream.
  • Do you know if there is a free service we can use to test the Xtream API? Everything we have here uses M3U.

@superolmo
Copy link
Contributor Author

@clefebvre I have removed the pypi reference, the flag name change, and the relative path changes.

@superolmo
Copy link
Contributor Author

Just a word caution, in the past few months, I have been reading lots of negative news about xtream iptv. I do not know of any free IPTV service that use xtream, and it seems that most, if not all, providers are staying away from this protocol in fear of getting sued.

@ghost
Copy link

ghost commented Sep 28, 2021

Tested with my paid xtream provider and working good.

@milomak
Copy link

milomak commented Nov 19, 2021

so this is now incorporated in the main repo?

@clefebvre clefebvre merged commit 48fd9a2 into linuxmint:master Nov 23, 2021
@gromez
Copy link

gromez commented Nov 26, 2021

Just tried Hypnotix 2.1 with XC API support and it seems only some channels are loading in only one group, all other groups are empty.
Debug log looks ok:

Loaded 34 Live Groups in 0.000 seconds
Loaded 4551 Live Streams in 0.000 seconds
Loaded 29 VOD Groups in 0.000 seconds
Loaded 5365 VOD Streams in 0.000 seconds
Loaded 31 Series Groups in 0.000 seconds
Loaded 915 Series Streams in 0.000 seconds

I will try to debug what's wrong.

@gromez
Copy link

gromez commented Nov 26, 2021

@superolmo I found the problem, it's here: https://github.com/linuxmint/hypnotix/blob/master/usr/lib/hypnotix/xtream.py#L583
My provider has channel names like this: |RU| Kinomiks 173
So, the alnum function check the first char | and return False. Is it possible to change this test?
Thank you

@superolmo
Copy link
Contributor Author

@gromez Yes, it is possible. Would you mind opening an issue? Also, does your provider send subgroups as channels with no stream in it?

@gromez
Copy link

gromez commented Nov 30, 2021

@superolmo reported here #177
And yes I think the subgroups are sent as channels like this ▀▄ SW ▀▄▀▄ DOCS ▄▀▄▀▄▀ so I think that's why you have a check for alnum on first char.

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.

None yet

5 participants