Skip to content

Commit

Permalink
Merge pull request #25 from tzagim/3.5.9
Browse files Browse the repository at this point in the history
3.5.9
  • Loading branch information
tzagim authored Jun 5, 2024
2 parents 267f44f + 63c399c commit 9080355
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 21 deletions.
8 changes: 4 additions & 4 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.idanplus" name="עידן+ פלוס" version="3.5.8" provider-name="Fishenzon">
<addon id="plugin.video.idanplus" name="עידן+ פלוס" version="3.5.9" provider-name="Fishenzon">
<requires>
<import addon="script.module.requests"/>
<import addon="script.module.xmltodict"/>
Expand All @@ -8,8 +8,8 @@
<provides>video</provides>
</extension>
<extension point="xbmc.service" library="resources/lib/service.py" start="[login|startup]"/>
<extension library="resources/" point="xbmc.python.module" />
<extension library="resources/lib/" point="xbmc.python.module" />
<extension point="xbmc.python.module" library="resources/" />
<extension point="xbmc.python.module" library="resources/lib/" />
<extension point="xbmc.addon.metadata">
<reuselanguageinvoker>true</reuselanguageinvoker>
<assets>
Expand All @@ -19,7 +19,7 @@
<platform>all</platform>
<summary lang="en">צפיה בערוצי עידן פלוס ובתכניות מהאתרים הרשמיים.</summary>
<description lang="en">צפיה בערוצי עידן פלוס ובתכניות מהאתרים הרשמיים.[CR]אפשרויות שונות בהגדרות ההרחבה ובקליק ימני על פריט ברשימה.</description>
<news>- Fix for Kan icons.[CR]- Fix for Keshet.[CR]- Added cache.</news>
<news>- Addon loads faster.[CR]- Fix for Reshet old site VODs.</news>
<supportedcontent>
<content>tvshows</content>
</supportedcontent>
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v3.5.9 - 05/06/2024
- Addon loads faster.
- Fix for Reshet old site VODs.

v3.5.8 - 12/05/2024
- Fix for Kan icons.
- Fix for Keshet.
Expand Down
4 changes: 2 additions & 2 deletions resources/language/English/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
<string id="30613">כנסת 99</string>
<string id="30618">רענון רשימה</string>
<string id="30619">ערוץ הקניות 21</string>
<string id="30621">האח הגדול 26</string>
<string id="30625">האח הגדול 26 - גיבוי</string>
<string id="30621">האח הגדול 26 - מנותקים</string>
<string id="30625">האח הגדול 26 - מנותקים - גיבוי</string>
<string id="30622">Ynet Live</string>
<string id="30623">כאן 4K</string>
<string id="30624">וואלה+</string>
Expand Down
4 changes: 2 additions & 2 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,11 @@ msgid "ערוץ הקניות 21"
msgstr ""

msgctxt "#30621"
msgid "האח הגדול 26"
msgid "האח הגדול 26 - מנותקים"
msgstr ""

msgctxt "#30625"
msgid "האח הגדול 26 - גיבוי"
msgid "האח הגדול 26 - מנותקים - גיבוי"
msgstr ""

msgctxt "#30622"
Expand Down
13 changes: 9 additions & 4 deletions resources/lib/common.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import xbmc, xbmcgui, xbmcplugin, xbmcaddon
import sys, gzip, os, io, random, re, json, urllib, requests, xmltodict, time, collections, xml.parsers.expat as expat
import resources.lib.cloudscraper as cloudscraper
import sys, gzip, os, io, random, re, json, urllib, xmltodict, time, collections, xml.parsers.expat as expat
#import requests, resources.lib.cloudscraper as cloudscraper
#import zipfile

try:
Expand Down Expand Up @@ -139,8 +139,8 @@ def translatePath(path):
'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36',
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.130 Safari/537.36'
]
# userAgent = random.choice(userAgents)
userAgent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0'
userAgent = random.choice(userAgents)


def GetAddon():
Addon = xbmcaddon.Addon(AddonID)
Expand Down Expand Up @@ -229,10 +229,12 @@ def GetUserAgent():
return userAgent

def GetSession():
import requests
return requests.session()

def OpenURL(url, headers={}, user_data=None, session=None, cookies=None, retries=1, responseMethod='text', verify=True):
link = ""
import requests
if headers.get('Accept-encoding', '') == '':
headers['Accept-encoding'] = 'gzip'
if headers.get('User-agent', '') == '':
Expand Down Expand Up @@ -267,6 +269,7 @@ def OpenURL(url, headers={}, user_data=None, session=None, cookies=None, retries

def GetRedirect(url, headers={}):
try:
import requests
response = requests.head(url, headers=headers, allow_redirects=False)
if response.status_code in set([301, 302, 303, 307]) and 'location' in response.headers:
url = response.headers['location']
Expand Down Expand Up @@ -663,6 +666,7 @@ def GetYouTube(url):


def GetCF(url, ua=None, retries=10, responseMethod='text'):
import resources.lib.cloudscraper as cloudscraper
for i in range(retries):
try:
scraper = cloudscraper.create_scraper(interpreter = 'native')
Expand All @@ -681,6 +685,7 @@ def GetCF(url, ua=None, retries=10, responseMethod='text'):
return ''

def GetCFheaders(url, ua=None, retries=10):
import resources.lib.cloudscraper as cloudscraper
for i in range(retries):
try:
scraper = cloudscraper.create_scraper(interpreter = 'native')
Expand Down
9 changes: 6 additions & 3 deletions resources/lib/keshet.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
programUrl = "{0}/_next/data/4.7.0/{{0}}/{{1}}.json?mako_vod_channel={{0}}&program={{1}}".format(baseUrl)
entitlementsServices = 'https://mass.mako.co.il/ClicksStatistics/entitlementsServicesV2.jsp'
UA = common.GetUserAgent()

UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36'

def GetJson(url):
resultJSON = common.OpenURL(url, headers={"User-Agent": UA}, responseMethod='json')
Expand Down Expand Up @@ -42,7 +42,7 @@ def GetCategoriesList(iconimage):
def GetSeriesList(url, iconimage):
url = "{0}&{1}".format(url, endings) if "?" in url else "{0}?{1}".format(url, endings)
#prms = GetJson(url)
prms = cache.get(GetJson, 24, url, table='pages')
prms = cache.get(GetJson, 72, url, table='pages')
if prms is None:
"Cannot get list for url {0}".format(url)
return
Expand Down Expand Up @@ -155,7 +155,8 @@ def WatchLive(url, name='', iconimage='', quality='best'):
'24': '{0}/mako-vod-live-tv/VOD-b3480d2eff3fd31006.htm'.format(baseUrl),
'2025': '{0}/mako-vod-live-tv/VOD-7469dcd71dcb761006.htm'.format(baseUrl)
}
PlayItem(channels[url], name, iconimage, quality, swichCdn=True)
#PlayItem(channels[url], name, iconimage, quality, swichCdn=True)
PlayItem(channels[url], name, iconimage, quality='auto', swichCdn=True)

def PlayItem(url, name='', iconimage='', quality='best', swichCdn=False):
prms = GetJson("{0}?{1}".format(url, endings))
Expand Down Expand Up @@ -204,6 +205,8 @@ def GetLink(media, cdn, dv, headers, quality):
if url.startswith('//'):
url = 'https:{0}'.format(url)
#xbmc.log('{0}?{1}'.format(url, ticket), 5)
if quality == 'auto':
return '{0}&{1}'.format(url, ticket) if '?' in url else '{0}?{1}'.format(url, ticket), None
session = common.GetSession()
link = common.GetStreams('{0}&{1}'.format(url, ticket) if '?' in url else '{0}?{1}'.format(url, ticket), headers=headers, session=session, quality=quality)
#xbmc.log(link, 5)
Expand Down
7 changes: 4 additions & 3 deletions resources/lib/reshet.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ def GetSeriesListOld(url, iconimage):
continue
series[link] = name
seriesIDs.append(seriesID)
image = serie['imageObj']['d']
pageTitle = serie.get('secondaryTitle', {})
description = '' if pageTitle is None else common.encode(pageTitle, 'utf-8')
matches = [grids_arr.index(x) for x in grids_arr if link == x[1]]
if len(matches) == 1:
grids_arr[matches[0]] = (name, link, serie['image'], {"Title": name, "Plot": description,'mediatype': 'movie'})
grids_arr[matches[0]] = (name, link, image, {"Title": name, "Plot": description,'mediatype': 'movie'})
else:
grids_arr.append((name, link, serie['image'], {"Title": name, "Plot": description,'mediatype': 'movie'}))
grids_arr.append((name, link, image, {"Title": name, "Plot": description,'mediatype': 'movie'}))
except Exception as ex:
xbmc.log('SerieID: {0}\n{1}'.format(seriesID, str(ex)), 3)
mainMenus = result.get('Header', {}).get('mainMenu', [])
Expand Down Expand Up @@ -392,7 +393,7 @@ def GetNewsCategoriesList(iconimage):
def GetSeriesList(url, iconimage):
#result = GetUrlJson(url, root=True)
root = True
result = cache.get(GetUrlJson, 24, url, root, table='pages')
result = cache.get(GetUrlJson, 72, url, root, table='pages')
if len(result) < 1:
return
buildId = result['buildId']
Expand Down
14 changes: 11 additions & 3 deletions resources/lib/service.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import xbmc
from time import time

refreshCommand = 'RunPlugin(plugin://plugin.video.idanplus/?mode=7)'
xbmc.executebuiltin(refreshCommand)
xbmc.executebuiltin('AlarmClock(idanplus,{0},12:00:00,silent,loop)'.format(refreshCommand))
end_pause = time() + 15
monitor = xbmc.Monitor()
wait_for_abort = monitor.waitForAbort

while not monitor.abortRequested():
while time() < end_pause: wait_for_abort(1)
refreshCommand = 'RunPlugin(plugin://plugin.video.idanplus/?mode=7)'
xbmc.executebuiltin(refreshCommand)
xbmc.executebuiltin('AlarmClock(idanplus,{0},12:00:00,silent,loop)'.format(refreshCommand))
break

0 comments on commit 9080355

Please sign in to comment.