Skip to content

Commit

Permalink
request-adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
Amined9 committed Sep 17, 2024
1 parent ba2ee3f commit 51e86a9
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions movies_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import shutil
import string
import subprocess
import json

import requests
from PySide6.QtCore import (
Expand Down Expand Up @@ -421,17 +422,23 @@ def do_handshake(self, url, mac, serverload="/server/load.php", load=True):
return self.do_handshake(url, mac, serverload)
print("Error in handshake:", e)
return False

def load_stb_movies(self, url, options):
url = URLObject(url)
url = f"{url.scheme}://{url.netloc}"
page = 0
Allmovies = []
try:
fetchurl = f"{url}/server/load.php?type=vod&action=get_ordered_list&genre=0&category=*&p={page}&sortby=added"
fetchurl = f"{url}/server/load.php?type=vod&action=get_ordered_list"
response = requests.get(fetchurl, headers=options["headers"])
result = response.json()
movies = result["js"]["data"]
self.display_movies(movies)
length = int(result["js"]["total_items"] / result["js"]["max_page_items"])
for i in range(length):
fetchurl = f"{url}/server/load.php?type=vod&action=get_ordered_list&genre=0&category=*&p={i}&sortby=added"
response = requests.get(fetchurl, headers=options["headers"])
result = response.json()
movies = result["js"]["data"]
Allmovies += movies
self.display_movies(Allmovies)
self.config["data"][self.config["selected"]]["options"] = options
self.config["data"][self.config["selected"]]["movies"] = movies
self.save_config()
Expand Down

0 comments on commit 51e86a9

Please sign in to comment.