Skip to content

Commit

Permalink
Added support for slovak version sk.mall.tv
Browse files Browse the repository at this point in the history
Added country select setting
  • Loading branch information
kapitan-iglu committed Sep 30, 2019
1 parent 7b0d48c commit 30584bd
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# plugin.video.mall.tv

Video doplněk do [kodi](http://www.kodi.tv/) pro přehrávání videí z internehové televize [mall.tv](https://www.mall.tv/).
Video doplněk do [kodi](http://www.kodi.tv/) pro přehrávání videí z české a slovenské internetové televize [mall.tv](https://www.mall.tv/).

Informace o instalaci najdete na stránkách repozitáře [Kodi CZ/SK](http://kodi-czsk.github.io/repository/).
3 changes: 2 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
2019-09-30 [0.0.9]
* Force czech version regardless of geolocation
* Added support for slovak version sk.mall.tv
* Added country select setting
2019-02-15 [0.0.8]
* Added possibility to choose format (HLS/MP4) - thx bbaronSVK
2018-10-30 [0.0.7]
Expand Down
9 changes: 5 additions & 4 deletions mall.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@

class MallApi():

BASE = 'https://www.mall.tv'

def __init__(self, plugin):
self.plugin = plugin
if self.plugin.get_setting('country') == '0':
self.BASE = 'https://www.mall.tv'
else:
self.BASE = 'https://sk.mall.tv'

def warn(self, *args, **kwargs):
self.plugin.log.warning(*args, **kwargs)
Expand All @@ -18,8 +20,7 @@ def url_for(self, *args, **kwargs):
return self.plugin.url_for(*args, **kwargs)

def get_page(self, url):
cookies = dict(__selectedLanguage='cz')
r = requests.get(self.BASE + url, cookies=cookies)
r = requests.get(self.BASE + url, cookies=dict(__selectedLanguage= 'cz' if self.plugin.get_setting('country') == '0' else 'sk'))
return BeautifulSoup(r.content, 'html.parser')

def get_categories(self, ):
Expand Down
3 changes: 3 additions & 0 deletions resources/language/Czech/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@
<string id="30013">Nejsledovanější</string>
<string id="30014">Přejít k pořadu</string>
<string id="30015">Video formát</string>
<string id="30016">Jazyková verze</string>
<string id="30017">Česká</string>
<string id="30018">Slovenská</string>
</strings>
3 changes: 3 additions & 0 deletions resources/language/English/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@
<string id="30013">Popular</string>
<string id="30014">Go to show</string>
<string id="30015">Video format</string>
<string id="30016">Language version</string>
<string id="30017">Czech</string>
<string id="30018">Slovak</string>
</strings>
3 changes: 3 additions & 0 deletions resources/language/Slovak/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@
<string id="30013">Nejsledovanejšie</string>
<string id="30014">Prejsť k relácii</string>
<string id="30015">Video formát</string>
<string id="30016">Jazyková verzia</string>
<string id="30017">Česká</string>
<string id="30018">Slovenská</string>
</strings>
1 change: 1 addition & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<setting type="lsep" label="30003" />
<setting label="30004" id="max_quality" type="labelenum" lvalues="30009|30008|30007|30006|30005" default="1080" />
<setting label="30015" id="format" type="labelenum" values="HLS|MP4" default="HLS"/>
<setting label="30016" id="country" type="enum" lvalues="30017|30018" default="0"/>
</settings>

0 comments on commit 30584bd

Please sign in to comment.