2022-01-07, 13:00
hi i am working on an stalker client for mz own
livetv is working but with the vod i have a little bit problems
save the js to file is not a problem but it takes a verlz long time cuy must send request for every single page wich
onlz gives data back for 14items
çmost portals have about 10000 items in the vod section so need to send about 700 request...thats too much
so i want to usw "get_category" so i only need to load onlz choosen categorz ( movie german, movie english and so on)
to create the folder for the vod streams i use this function
this send an "url" with informations to another function
in build url i take the rigth id wich i want to use how i can extract/read the url
to use it in another script
here:
category : here i need the number
sorry for my bad englisch and my dirty code...
it was not mz code i onlz updated it to pzthon3 and change it for my own use....i am not realy a programmer
please can somebody help me
livetv is working but with the vod i have a little bit problems
save the js to file is not a problem but it takes a verlz long time cuy must send request for every single page wich
onlz gives data back for 14items
çmost portals have about 10000 items in the vod section so need to send about 700 request...thats too much
so i want to usw "get_category" so i only need to load onlz choosen categorz ( movie german, movie english and so on)
to create the folder for the vod streams i use this function
python:def GenresVOD():
try:
data = vod.getGenresVOD(portal['mac'], portal['url'], portal['serial'], addondir);
except Exception as e:
xbmcgui.Dialog().notification(addonname, str(e), xbmcgui.NOTIFICATION_ERROR );
return;
data = data['genresVOD'];
for id, i in list(data.items()):
title = i["title"];
category = i["genre"];
url = build_url({
'mode': 'channelsVOD',
'genre_name': title.title(),
'id': category, i want to get this number
'portal' : json.dumps(portal)
});
li = xbmcgui.ListItem(title.title())
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li, isFolder=True);
xbmcplugin.endOfDirectory(addon_handle);
this send an "url" with informations to another function
in build url i take the rigth id wich i want to use how i can extract/read the url
Quote:plugin://plugin.video.stalkerportal/?genre_name=Movie: Netherlands &;id=365&;mode=channelsVOD&;portal={"parental": "", "password": "", "name": "24.02.2022", "url": "http://portalurl", "mac": "my mac", "serial": nullin this example i need to take out the number 365
to use it in another script
here:
category : here i need the number
python:def getVoDchannels(portal_mac, url, serial, path):
now = time();
portalurl = "_".join(re.findall("[a-zA-Z0-9]+", url));
portalurl = path + '/' + portalurl + '-vodchannels';
setMac(portal_mac);
setSerialNumber(serial);
if not os.path.exists(path):
os.makedirs(path)
if os.path.exists(portalurl):
with open(portalurl) as data_file: data = json.load(data_file);
handshake(url);
data=data1
data = '{ "version" : "' + cache_version + '", "time" : "' + str(now) + '", "vodchannels" : [ \n'
page = 1;
while True:
info = retrieveData(url, values = {
'type' : 'vod',
'action' : 'get_ordered_list',
'sortby' : 'year',
'not_ended' : '0',
'category' : here i need the number,
'p' : page,
'fav' : '0',
'JsHttpRequest' : '1-xml'})
results = info['js']['data']
for i in results:
name = i["name"]
cmd = i['cmd']
logo = i["screenshot_uri"]
category_id = i["category_id"]
data += '{"name":"'+ name +'", "cmd":"'+ cmd +'", "logo":"'+ logo +'"}, \n'
page += 1;
if page > pages or page == 200:
break;
data = data[:-3] + '\n]}'
with open(portalurl, 'wb') as f: f.write(data.encode('utf-8'));
return json.loads(data.encode('utf-8'));
sorry for my bad englisch and my dirty code...
it was not mz code i onlz updated it to pzthon3 and change it for my own use....i am not realy a programmer
please can somebody help me