Skip to content

Commit

Permalink
v2.4.1_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz89B committed Feb 15, 2023
1 parent 1ecb10e commit c1d50f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="plugin.video.viaplay" version="2.4.1-beta.1" name="Viaplay" provider-name="mariusz89b, emilsvennesson, heppen-dev, zuzia-dev">
<addon id="plugin.video.viaplay" version="2.4.1-beta.2" name="Viaplay" provider-name="mariusz89b, emilsvennesson, heppen-dev, zuzia-dev">
<requires>
<import addon="script.module.requests" version="2.9.1" />
<import addon="script.module.iso8601" version="0.1.11" />
Expand Down
7 changes: 6 additions & 1 deletion resources/lib/viaplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,15 @@ def get_collections(self, url):
def get_products(self, url, filter_event=False, search_query=None):
"""Return a dict containing the products and next page if available."""
if search_query:
headers = {
'accept': '*/*',
'accept-language': 'sv,en;q=0.9,en-GB;q=0.8,en-US;q=0.7',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.41',
}
params = {'query': search_query}
else:
params = None
data = self.make_request(url, method='get', params=params)
data = self.make_request(url, method='get', params=params, headers=headers)

if 'list' in data['type'].lower():
products = data['_embedded']['viaplay:products']
Expand Down

0 comments on commit c1d50f4

Please sign in to comment.