• Vítejte na XBMC-Kodi.cz
  • Česko-slovenská komunita fanoušků XBMC/Kodi
Vítejte návštevníku! Přihlášení Registrace


Hodnocení tématu:
  • 2 Hlas(ů) - 5 Průměr
  • 1
  • 2
  • 3
  • 4
  • 5
Yet Another BOmbuj Plugin
#13
Tak abych taky něčím přispěl, tak ukážu, jak se dá o něco zjednodušit a zpříjemnit openload párování. Podmínek pro použití uvedeného postupu je několik:
  • Umíte z Kodi spouštět browser, buď máte tuto funkci instalovanou jako addon nebo jste natolik zruční, že jste schopni něco takového zajistit vlastními silami. Existuje Chrome jako addon pro LibreELEC v generické (Intel/AMD/nVidia) instalaci nebo například Chrome Launchcer, který spouští Chrome ze systému, ten je k dostání na vícero instalacích. Já osobně to mám odzkoušené na LibreELEC běžícím na Intelu. Otestoval jsme si to u sebe a pak to instaloval u dvou známých. Ve všech případech úspěšně.
  • Jste ochotni (a schopni) provést malou úpravu v addon script.module.resolveurl, který je napsát v Python.
  • Ovládáte Kodi myší (to proto, protože budete potřebovat oklikat dobře známou stránku párování olpair.com.
Celá úprava směřuje k tomu, aby v místě, kde vás addon, resp. script.module.resolver, vyzve k tomu, abyste provedli párování, spustil browser s adresou stránky párování. Postup je následující.

V addon script.module.resolver, v souboru openload.py, který najdete na adrese .../script.module.resolveurl/lib/resolveurl/plugins/, provedete dále uvedené změny. Ty jsou převzaté z úpravy pro LibreELEC a addon browser.chrome. Pro jiný systém a addon se to volání může pochopitelně změnit.

Doplníte import knihovny xbmc, tedy přidáte řádek:
Kód:
import xbmc

V definici procedury __auth_ip přidáte řádek obsahující xbmc.executebuiltin(...) Celá procedura pak bude vypadat takto:
Kód:
   def __auth_ip(self, media_id):
       js_data = self.__get_json(INFO_URL)
       pair_url = js_data.get('result', {}).get('auth_url', '')
       if pair_url:
           pair_url = pair_url.replace('\/', '/')
           header = i18n('ol_auth_header')
           line1 = i18n('auth_required')
           line2 = i18n('visit_link')
           line3 = i18n('click_pair').decode('utf-8') % (pair_url)
           with common.kodi.CountdownDialog(header, line1, line2, line3) as cd:
               xbmc.executebuiltin('RunAddon(browser.chrome, http://olpair.com/)') # pridano spusteni browseru
               return cd.start(self.__check_auth, [media_id])

Celé to pak funguje tak, že se vám v okamžiku, když musíte párovat, zobrazí krátce okno s upozorněním na párování, ve kterém ubíhá čas a hned poté se spustí browser se zobrazenou stránkou olpair.com. Oklikáte co máte a okno zavřete (klikem na X v pravém horním rohu, nebo zadáním klávesové zkratky pro zavření okna, případně stiskem příslušného tlačítka na ovladači, pokud na něm takovou možnost máte, viz. Použití DO v externí aplikaci Chrome spouštěné z Kodi v LE [xdotools].

Samozřejmě, že jiné možnosti párování touto úpravou nejsou dotčené. Budou se vám hodit v případě, pokud se addon script.module.resolver aktualizuje (ať už ručně nebo automaticky). V takovém případě bude tato úprava samozřejmě přepsaná novou verzí a vy ji budete muset provést znova.
 
Citovat
  


Příspěvků v tématu
Yet Another BOmbuj Plugin - od cache - 14.3.2019, 19:03
RE: Yet Another BOmbuj Plugin - od Alesn - 14.3.2019, 22:27
RE: Yet Another BOmbuj Plugin - od Client - 15.3.2019, 13:36
RE: Yet Another BOmbuj Plugin - od bara - 01.8.2020, 16:38
RE: Yet Another BOmbuj Plugin - od cache - 14.3.2019, 23:51
RE: Yet Another BOmbuj Plugin - od sanc0 - 15.3.2019, 8:54
RE: Yet Another BOmbuj Plugin - od Client - 15.3.2019, 10:37
RE: Yet Another BOmbuj Plugin - od cache - 15.3.2019, 13:49
RE: Yet Another BOmbuj Plugin - od Client - 15.3.2019, 14:36
RE: Yet Another BOmbuj Plugin - od cache - 15.3.2019, 16:33
RE: Yet Another BOmbuj Plugin - od Client - 15.3.2019, 16:36
RE: Yet Another BOmbuj Plugin - od Client - 15.3.2019, 23:49
RE: Yet Another BOmbuj Plugin - od cache - 18.3.2019, 13:40
RE: Yet Another BOmbuj Plugin - od Client - 18.3.2019, 13:49
RE: Yet Another BOmbuj Plugin - od cache - 19.3.2019, 14:47
RE: Yet Another BOmbuj Plugin - od Client - 19.3.2019, 16:05
Yet Another BOmbuj Plugin - od Saros - 19.3.2019, 16:12
RE: Yet Another BOmbuj Plugin - od cache - 19.3.2019, 18:20
RE: Yet Another BOmbuj Plugin - od ros - 19.3.2019, 19:04
Yet Another BOmbuj Plugin - od Saros - 20.3.2019, 6:19
RE: Yet Another BOmbuj Plugin - od cache - 20.3.2019, 12:51
RE: Yet Another BOmbuj Plugin - od Client - 20.3.2019, 14:26
RE: Yet Another BOmbuj Plugin - od cache - 20.3.2019, 18:20
RE: Yet Another BOmbuj Plugin - od Jochy - 21.3.2019, 15:35
RE: Yet Another BOmbuj Plugin - od cache - 21.3.2019, 22:47
RE: Yet Another BOmbuj Plugin - od Jochy - 22.3.2019, 15:06
RE: Yet Another BOmbuj Plugin - od cache - 27.3.2019, 17:56
RE: Yet Another BOmbuj Plugin - od cache - 27.5.2019, 15:47
RE: Yet Another BOmbuj Plugin - od cache - 28.6.2019, 13:11
RE: Yet Another BOmbuj Plugin - od Jochy - 28.5.2019, 9:06
RE: Yet Another BOmbuj Plugin - od cache - 28.5.2019, 10:09
RE: Yet Another BOmbuj Plugin - od cache - 29.5.2019, 16:22
RE: Yet Another BOmbuj Plugin - od cache - 05.6.2019, 17:26
RE: Yet Another BOmbuj Plugin - od picky88 - 27.6.2019, 21:51
RE: Yet Another BOmbuj Plugin - od picky88 - 07.7.2019, 6:11
RE: Yet Another BOmbuj Plugin - od jiro77 - 07.7.2019, 10:36
RE: Yet Another BOmbuj Plugin - od cache - 07.7.2019, 11:00
RE: Yet Another BOmbuj Plugin - od Capri - 07.7.2019, 12:23
RE: Yet Another BOmbuj Plugin - od cache - 07.7.2019, 14:21
RE: Yet Another BOmbuj Plugin - od cache - 08.7.2019, 9:13
RE: Yet Another BOmbuj Plugin - od cache - 08.7.2019, 10:53
RE: Yet Another BOmbuj Plugin - od lubinoo - 19.7.2019, 12:17
RE: Yet Another BOmbuj Plugin - od cache - 19.7.2019, 13:57
RE: Yet Another BOmbuj Plugin - od cache - 02.9.2019, 14:12
RE: Yet Another BOmbuj Plugin - od cache - 18.9.2019, 17:40
RE: Yet Another BOmbuj Plugin - od cache - 01.11.2019, 8:51
RE: Yet Another BOmbuj Plugin - od Slidercz - 01.11.2019, 10:31
RE: Yet Another BOmbuj Plugin - od BBaron - 02.11.2019, 16:38
RE: Yet Another BOmbuj Plugin - od cache - 02.11.2019, 18:51
RE: Yet Another BOmbuj Plugin - od cache - 03.11.2019, 3:05
RE: Yet Another BOmbuj Plugin - od cache - 07.12.2019, 20:06
RE: Yet Another BOmbuj Plugin - od cache - 10.12.2019, 14:22
RE: Yet Another BOmbuj Plugin - od BBaron - 11.12.2019, 8:22
RE: Yet Another BOmbuj Plugin - od Slidercz - 11.12.2019, 9:00
RE: Yet Another BOmbuj Plugin - od Client - 12.12.2019, 7:57
RE: Yet Another BOmbuj Plugin - od cache - 12.12.2019, 14:32
RE: Yet Another BOmbuj Plugin - od cache - 13.12.2019, 14:30
RE: Yet Another BOmbuj Plugin - od ben555 - 21.5.2020, 15:26
RE: Yet Another BOmbuj Plugin - od cache - 24.12.2019, 10:43
RE: Yet Another BOmbuj Plugin - od cache - 27.12.2019, 19:25
RE: Yet Another BOmbuj Plugin - od cache - 25.3.2020, 15:33
RE: Yet Another BOmbuj Plugin - od cache - 06.4.2020, 23:02
RE: Yet Another BOmbuj Plugin - od cache - 21.5.2020, 15:44
RE: Yet Another BOmbuj Plugin - od cache - 31.7.2020, 12:33
RE: Yet Another BOmbuj Plugin - od Slidercz - 31.7.2020, 16:49
RE: Yet Another BOmbuj Plugin - od jiro77 - 31.7.2020, 19:53
RE: Yet Another BOmbuj Plugin - od cache - 01.8.2020, 14:42
RE: Yet Another BOmbuj Plugin - od cache - 03.8.2020, 13:35
RE: Yet Another BOmbuj Plugin - od jiro77 - 03.8.2020, 14:10
Yet Another BOmbuj Plugin - od Saros - 03.8.2020, 14:24
RE: Yet Another BOmbuj Plugin - od cache - 03.8.2020, 14:53
RE: Yet Another BOmbuj Plugin - od cache - 03.8.2020, 18:44
RE: Yet Another BOmbuj Plugin - od jiro77 - 05.9.2020, 14:43
RE: Yet Another BOmbuj Plugin - od cache - 07.9.2020, 9:22
RE: Yet Another BOmbuj Plugin - od jiro77 - 20.8.2022, 11:36
RE: Yet Another BOmbuj Plugin - od cache - 25.8.2022, 19:22
RE: Yet Another BOmbuj Plugin - od jiro77 - 25.8.2022, 20:07
RE: Yet Another BOmbuj Plugin - od cache - 25.8.2022, 20:35

Přejít na fórum:


Prochází: 2 host(ů)