Ejemplo n.º 1
0
def o0o00o0():
    i1IIi11111i("Login", "/login")
    xbmc.executebuiltin('Dialog.Close(busydialog)')
    try:
        iIi1ii1I1 = requests.get(
            "http://echipstore.com/get-code/?nocache=true").json()
        o0 = iIi1ii1I1["message"] % iIi1ii1I1["user_code"].upper()
        I11II1i = xbmcgui.DialogProgress()
        I11II1i.create('Login', o0)
        if 23 - 23: ooO00oOoo / iiI1i1 + i1iIIII + i1iIIII / Iii1IIIiiI
        iiI1 = 0
        while iiI1 < 60:
            i11Iiii = int((iiI1 / 60.0) * 100)
            if I11II1i.iscanceled():
                break
            I11II1i.update(i11Iiii, "")
            iiI1 = iiI1 + 1
            xbmc.sleep(5000)
            iII1i1I1II = requests.get(
                "http://echipstore.com/device?device_code=%s&nocache=true" %
                urllib.quote_plus(iIi1ii1I1["device_code"]))
            if "token" in iII1i1I1II.text:
                o0O.setSetting("token", iII1i1I1II.json()["token"])
                o0O.setSetting("email", iII1i1I1II.json()["email"])
                break
        I11II1i.close()
        del I11II1i
        xbmc.executebuiltin('XBMC.Container.Update(%s)' % iI11I1II1I1I)
    except:
        i1 = xbmcgui.Dialog()
        i1.ok("Oops!", "Có lỗi xảy ra. Xin quý vị vui lòng login vào dịp khác")
        if 48 - 48: ooO0OO000o + ooO0OO000o - ooO00oOoo.i1iIIIiI1I / I11i11Ii
Ejemplo n.º 2
0
def i1IIi11111i():
    o000o0o00o0Oo("Login", "/login")
    xbmc.executebuiltin('Dialog.Close(busydialog)')
    try:
        oo = requests.get(
            "http://echipstore.com/get-code/?nocache=true").json()
        IiII1I1i1i1ii = oo["message"] % oo["user_code"].upper()
        IIIII = xbmcgui.DialogProgress()
        IIIII.create('Login', IiII1I1i1i1ii)
        if 26 - 26: O00OoOoo00.iiiI11 / oooOOOOO * IiiIII111ii / i1iIIi1
        ii11iIi1I = 0
        while ii11iIi1I < 60:
            iI111I11I1I1 = int((ii11iIi1I / 60.0) * 100)
            if IIIII.iscanceled():
                break
            IIIII.update(iI111I11I1I1, "")
            ii11iIi1I = ii11iIi1I + 1
            xbmc.sleep(5000)
            i1I11i = requests.get(
                "http://echipstore.com/device?device_code=%s&nocache=true" %
                urllib.quote_plus(oo["device_code"]))
            if "token" in i1I11i.text:
                Oo0Ooo.setSetting("token", i1I11i.json()["token"])
                Oo0Ooo.setSetting("email", i1I11i.json()["email"])
                break
        IIIII.close()
        del IIIII
        xbmc.executebuiltin('XBMC.Container.Update(%s)' % O0O0OO0O0O0)
    except:
        OOooO0OOoo = xbmcgui.Dialog()
        OOooO0OOoo.ok("Oops!",
                      "Có lỗi xảy ra. Xin quý vị vui lòng login vào dịp khác")
        if 29 - 29: o00o / IiI1I1
Ejemplo n.º 3
0
def get_final_video_and_cookie(sid, season, episode, choose_quality=False, download=False):
    cookie = get_user_cookie()
    req = requests.post(API + '/episode/preWatch', data={'SID': sid, 'season': season, 'episode': episode},
                        cookies=cookie, headers=HEADERS)
    token = req.text
    if not cookie:
        cookie = req.cookies.get_dict()

    if token == 'donor':
        vid = get_video_url(sid, season, episode, token, cookie, choose_quality)

    else:
        if download:
            plugin.notify('התחבר כמנוי כדי להוריד פרק זה', image=ICON)
            return None, None
        else:
            dp = xbmcgui.DialogProgress()
            dp.create("לצפייה באיכות HD וללא המתנה ניתן לרכוש מנוי", "אנא המתן 30 שניות", '',
                      "[COLOR orange][B]לרכישת מנוי להיכנס בדפדפן - www.sdarot.tv/donate[/B][/COLOR]")
            dp.update(0)
            for s in range(30, -1, -1):
                time.sleep(1)
                dp.update(int((30 - s) / 30.0 * 100), "אנא המתן 30 שניות", 'עוד {0} שניות'.format(s), '')
                if dp.iscanceled():
                    dp.close()
                    return None, None

        vid = get_video_url(sid, season, episode, token, cookie, choose_quality)

    if vid:
            return vid, cookie
Ejemplo n.º 4
0
def play(cid,phone="",passw=""):
	if phone == "": phone = plugin.get_setting('usernamesctv')
	if passw == "":
		passw = plugin.get_setting('passwordsctv')
		hash_object = hashlib.md5(passw)
		passw = hash_object.hexdigest()
	valid_device_id, valid_user_id  = GetValidID(phone, passw)
	if valid_user_id:
		dialogWait = xbmcgui.DialogProgress()
		dialogWait.create('SCTV', 'Đang mở kênh...')
		plugin.set_resolved_url(get_playable_url(cid,valid_user_id,valid_device_id))
		dialogWait.close()
		del dialogWait
	else:
		dialog = xbmcgui.Dialog()
		yes = dialog.yesno(
			'Số Phone hoặc Password không đúng!',
			'Chưa có tài khoản SCTV, tải app và đăng ký. Bạn có nhập tài khoản bây giờ không?',
			yeslabel='OK, nhập ngay',
			nolabel='Nhập sau!'
		)
		if yes:
			plugin.open_settings()
			# print "SCTV Phone %s saved!" % plugin.get_setting('usernamesctv')
			play(cid)
Ejemplo n.º 5
0
def play(cid, phone="", passw=""):
    if phone == "": phone = plugin.get_setting('usernamesctv')
    if passw == "":
        passw = plugin.get_setting('passwordsctv')
        # hash_object = hashlib.md5(passw)
        # passw = hash_object.hexdigest()
    user_name, sess = LogIn(phone, passw)
    if user_name is not None:
        dialogWait = xbmcgui.DialogProgress()
        dialogWait.create(
            'SCTV (tv24.vn)',
            'Chào [COLOR orange]%s[/COLOR]. Đang mở kênh %s. Vui lòng đợi trong giây lát...'
            % (user_name.encode("utf8"), cid))
        plugin.set_resolved_url(get_playable_url(cid, sess))
        dialogWait.close()
        del dialogWait
    else:
        dialog = xbmcgui.Dialog()
        yes = dialog.yesno(
            'Đăng nhập không thành công!\n',
            'Chưa có tài khoản? Đăng ký tại [COLOR lime]tv24.vn/dang-ky[/COLOR].\n[COLOR yellow]Bạn muốn nhập tài khoản bây giờ không?[/COLOR]',
            yeslabel='OK, nhập ngay',
            nolabel='Chờ tí, Đăng ký đã!')
        if yes:
            plugin.open_settings()
            play(cid)
Ejemplo n.º 6
0
def O0oOO0o0(cid):
    i1ii1iIII = xbmcgui.DialogProgress()
    i1ii1iIII.create('vtvplus.vn', 'Loading video. Please wait...')
    oo000.set_resolved_url(Oo0oO0oo0oO00(cid))
    i1ii1iIII.close()
    del i1ii1iIII
    if 8 - 8: OOo00O0Oo0oO / ooO
Ejemplo n.º 7
0
    def create_controller_mapping(self):
        self.logger.info('Starting mapping')

        controllers = ['XBOX', 'PS3', 'Wii']
        ctrl_type = xbmcgui.Dialog().select(
            self.core.string('choose_ctrl_type'), controllers)
        map_name = xbmcgui.Dialog().input(self.core.string('enter_filename'))

        progress_dialog = xbmcgui.DialogProgress()
        progress_dialog.create(self.core.string('name'),
                               self.core.string('starting_mapping'))

        self.core.logger.info('Trying to call subprocess')
        map_file = '%s/%s-%s.map' % (os.path.expanduser('~'),
                                     controllers[ctrl_type], map_name)

        success = self.moonlight_helper.create_ctrl_map(
            progress_dialog, map_file)

        if success:
            confirmed = xbmcgui.Dialog().yesno(
                self.core.string('name'), self.core.string('mapping_success'),
                self.core.string('set_mapping_active'))

            self.core.logger.info('Dialog Yes No Value: %s' % confirmed)

            if confirmed:
                self.plugin.set_setting('input_map', map_file)

        else:
            xbmcgui.Dialog().ok(self.core.string('name'),
                                self.core.string('mapping_failure'))
Ejemplo n.º 8
0
def iI(url):
    iI11iiiI1II = xbmcgui.DialogProgress()
    iI11iiiI1II.create('hieuhien.vn', 'Loading video. Please wait...')
    oo000.set_resolved_url(O0oooo0Oo00(url))
    iI11iiiI1II.close()
    del iI11iiiI1II
    if 17 - 17: iiiIIii1IIi % oo00000o0 % Oo0Ooo.IiII
Ejemplo n.º 9
0
def Ii1iIIIi1ii(url):
    I11i11Ii("Play", '/play/%s' % (url))
    o0oo0o0O00OO = xbmcgui.DialogProgress()
    o0oo0o0O00OO.create('phim60s.info', 'Loading video. Please wait...')
    oo000.set_resolved_url(o0oO(url))
    o0oo0o0O00OO.close()
    del o0oo0o0O00OO
    if 48 - 48: Oo + Oo / i1 / iiiIIii1IIi
Ejemplo n.º 10
0
def Ii1(url):
    I11i11Ii("Play", '/play/%s' % (url))
    III1i1i = xbmcgui.DialogProgress()
    III1i1i.create('phim7.com', 'Loading video. Please wait...')
    oo000.set_resolved_url(iiI1(url))
    III1i1i.close()
    del III1i1i
    if 19 - 19: Oo + OOo000
Ejemplo n.º 11
0
def OoOo(mid):
    I11i11Ii("Play", '/play/%s' % (mid))
    IiIiIi = xbmcgui.DialogProgress()
    IiIiIi.create('Hieuhien.vn', '. Please wait...')
    oo000.set_resolved_url(IIiI(mid))
    IiIiIi.close()
    del IiIiIi
    if 22 - 22: O0oo0OO0 % i1
Ejemplo n.º 12
0
def I1Ii(mid):
    I11i11Ii("Play", '/play/%s' % (mid))
    o0oOo0Ooo0O = xbmcgui.DialogProgress()
    o0oOo0Ooo0O.create('MovieBox', 'Loading video. Please wait...')
    oo000.set_resolved_url(OO00O0O0O00Oo(mid))
    o0oOo0Ooo0O.close()
    del o0oOo0Ooo0O
    if 25 - 25: IiiIII111iI % i1 - i1.i1
Ejemplo n.º 13
0
def oo0OooOOo0(url):
    o000o0o00o0Oo("Play %s" % url, "/play/%s" % url)
    IIIII = xbmcgui.DialogProgress()
    IIIII.create('Kodi4VN Launcher', 'Loading video. Please wait...')
    OO0o.set_resolved_url(o0O(url))
    IIIII.close()
    del IIIII
    if 72 - 72: IiiIII111ii / OOOo0 * I1IiI - o00o
Ejemplo n.º 14
0
def oOoOooOo0o0(url):
    I11i11Ii("Play", '/play/%s' % (url))
    OOOO = xbmcgui.DialogProgress()
    OOOO.create('Hieuhien.vn', 'Loading video. Please wait...')
    oo000.set_resolved_url(OOO00(url))
    OOOO.close()
    del OOOO
    if 21 - 21: iII111iiiii11 - iII111iiiii11
Ejemplo n.º 15
0
def iiIIII1i1i(url):
    I11i11Ii("Play", '/play/%s' % (url))
    iiI1 = xbmcgui.DialogProgress()
    iiI1.create('AnhTrang.org', 'Loading video. Please wait...')
    oo000.set_resolved_url(i11Iiii(url))
    iiI1.close()
    del iiI1
    if 23 - 23: IiiIII111iI.i1
Ejemplo n.º 16
0
def iiI1(url):
    I11i11Ii("Play", '/play/%s' % (url))
    i11Iiii = xbmcgui.DialogProgress()
    i11Iiii.create('Phim14', 'Loading video. Please wait...')
    oo000.set_resolved_url(iI(url))
    i11Iiii.close()
    del i11Iiii
    if 28 - 28:
        ooO00oOoo - iiIIIIi1i1.iiIIIIi1i1 + I1i1iI1i - iII111iiiii11 + OO0OO0O0O0
Ejemplo n.º 17
0
def InstallRepo(path="0", tracking_string=""):
    '''
	Cài đặt repo
	Parameters
	----------
	path : string
		Nếu truyền "gid" của Repositories sheet:
			Cài tự động toàn bộ repo trong Repositories sheet
		Nếu truyền link download zip repo
			Download và cài zip repo đó
	tracking_string : string
		 Tên dễ đọc của view
	'''
    GA(  # tracking
        "Install Repo - %s" % tracking_string, "/install-repo/%s" % path)
    if path.isdigit():  # xác định GID
        pDialog = xbmcgui.DialogProgress()
        pDialog.create('Vui lòng đợi', 'Đang cập nhật', 'Đang tải...')
        items = getItems(path)
        total = len(items)
        i = 0
        failed = []
        for item in items:
            done = int(100 * i / total)
            pDialog.update(done, 'Đang tải', item["label2"] + '...')
            try:
                item["path"] = "http" + item["path"].split("http")[-1]
                download(urllib.unquote_plus(item["path"]), item["label2"])
            except:
                failed += [item["label"].encode("utf-8")]
            if pDialog.iscanceled():
                break
            i += 1
        pDialog.close()
        if len(failed) > 0:
            dlg = xbmcgui.Dialog()
            s = "Không thể cài các rep sau:\n[COLOR orange]%s[/COLOR]" % "\n".join(
                failed)
            dlg.ok('Chú ý: Không cài đủ repo!', s)
        else:
            dlg = xbmcgui.Dialog()
            s = "Đã cập nhật thành công"
            dlg.ok('Cập nhật xong!', s)

    else:  # cài repo riêng lẻ
        try:
            download(path, "")
            dlg = xbmcgui.Dialog()
            s = "Repo %s đã được cài thành công" % tracking_string
            dlg.ok('Cài Repo thành công!', s)
        except:
            dlg = xbmcgui.Dialog()
            s = "Vùi lòng thử cài lại lần sau"
            dlg.ok('Cài repo thất bại!', s)

    xbmc.executebuiltin("XBMC.UpdateLocalAddons()")
    xbmc.executebuiltin("XBMC.UpdateAddonRepos()")
Ejemplo n.º 18
0
def get_video_link(players, params, mode, use_simple=False):
    lister = Lister()

    # Extend parameters
    for lang, lang_params in params.items():
        for key, value in lang_params.items():
            if isinstance(value, basestring):
                params[lang][key + "_+"] = value.replace(" ", "+")
                params[lang][key + "_-"] = value.replace(" ", "-")
                params[lang][key + "_escaped"] = value.replace(" ", "%2520")
                params[lang][key + "_escaped+"] = value.replace(" ", "%252B")

    pDialog = None
    selection = None
    try:
        if len(players) > 1 and use_simple:
            index = dialogs.select(_("Choose Your Channel..."),
                                   [player.title for player in players])
            if index == -1:
                return None
            players = [players[index]]

        resolve_f = lambda p: resolve_player(p, lister, params)

        if len(players) > 1:
            pDialog = xbmcgui.DialogProgress()
            pDialog.create('Meta', 'Working...')
            dialogs.wait_for_dialog("progressdialog", 5)
            pool_size = plugin.get_setting(SETTING_POOL_SIZE, converter=int)
            populator = lambda: execute(resolve_f, players, lister.stop_flag,
                                        pool_size)
            selection = dialogs.select_ext(_("Choose Your Channel..."),
                                           populator, len(players))

        else:
            result = resolve_f(players[0])
            if result:
                title, links = result
                if len(links) == 1:
                    selection = links[0]
                else:
                    index = dialogs.select(_("Choose Your Channel..."),
                                           [x['label'] for x in links])
                    if index > -1:
                        selection = links[index]
            else:
                dialogs.ok(_("Error"), _("Video not found :("))
    finally:
        lister.stop()

    return selection
Ejemplo n.º 19
0
    def pair_host(self):
        pair_dialog = xbmcgui.DialogProgress()
        pair_dialog.create(self.core.string('name'), 'Starting Pairing')

        success = self.moonlight_helper.pair_host(pair_dialog)

        if success:
            xbmcgui.Dialog().ok(self.core.string('name'),
                                'Successfully paired')
        else:
            confirmed = xbmcgui.Dialog().yesno(
                self.core.string('name'),
                'Pairing failed - do you want to try again?')
            if confirmed:
                self.pair_host()
Ejemplo n.º 20
0
    def pair_host(self):
        pair_dialog = xbmcgui.DialogProgress()
        pair_dialog.create(self.core.string('name'), 'Starting Pairing')

        message, state = self.moonlight_helper.pair_host(pair_dialog)
        pair_dialog.close()

        if state == AbstractPairingManager.STATE_PAIRED:
            xbmcgui.Dialog().ok(self.core.string('name'), message)
        else:
            confirmed = xbmcgui.Dialog().yesno(
                self.core.string('name'),
                '%s - Do you want to try again?' % message)
            if confirmed:
                self.pair_host()
Ejemplo n.º 21
0
def ii11i1iIII(args_json={}):
    Oo0oO0oo0oO00 = json.loads(args_json)
    II1Ii1iI1i(
        "[Play] %s" % (Oo0oO0oo0oO00["title"].encode("utf8") if "title"
                       in Oo0oO0oo0oO00 else "Unknow Title"), '/play/%s/%s' %
        (Oo0oO0oo0oO00["url"], json.dumps(Oo0oO0oo0oO00["payloads"])
         if "payloads" in Oo0oO0oo0oO00 else "{}"))
    Ii1IOo0o0 = xbmcgui.DialogProgress()
    Ii1IOo0o0.create('VTVGo',
                     'Đang tải, Xin quý khách vui lòng đợi trong giây lát...')
    oo000.set_resolved_url(
        III1ii1iII(Oo0oO0oo0oO00["url"]),
        subtitles=
        "https://raw.githubusercontent.com/vinhcomp/xml/master/xml/sub1.tsv")
    Ii1IOo0o0.close()
    del Ii1IOo0o0
    if 54 - 54: ooOO00oOo % O0 % O0
Ejemplo n.º 22
0
def iI1(args_json={}):
    i1I11i = json.loads(args_json)
    OoOoOO00(
        "[Play] %s" % (i1I11i["title"].encode("utf8") if "title" in i1I11i else
                       "Unknow Title"), '/play/%s/%s' %
        (i1I11i["url"],
         json.dumps(i1I11i["payloads"]) if "payloads" in i1I11i else "{}"))
    I11i = xbmcgui.DialogProgress()
    I11i.create('HPlus.vn',
                'Đang tải, Xin quý khách vui lòng đợi trong giây lát...')
    oo000.set_resolved_url(
        O0O(i1I11i["url"]),
        subtitles=
        "https://raw.githubusercontent.com/vinhcomp/xml/master/xml/sub1.tsv")
    I11i.close()
    del I11i
    if 78 - 78: i11ii11iIi11i.oOoO0oo0OOOo + IiiI / Iii1ii1II11i
Ejemplo n.º 23
0
    def get_episode_data(self, url):
        url = '{url}{style}'.format(url=url, style=self.mobile_style)
        print 'Get episode data: {url}'.format(url=url)

        data = util.get_remote_data(url)
        soup = BeautifulSoup(data, convertEntities=BeautifulSoup.HTML_ENTITIES)

        linklist = soup.find('ol', id='posts').find(
            'blockquote', 'postcontent restore').findAll('a')

        # correct links for erroneous formatting
        cleanlinks = util.clean_post_links(linklist)

        # parse post links
        p = Post(self.match_string)

        progress = xbmcgui.DialogProgress()
        progress.create('[B]Processing found links[/B]')
        total = len(cleanlinks)
        current = 0

        for url, text in cleanlinks.items():
            current += 1
            percent = (current * 100) // total
            msg = 'Processing {current} of {total}'.format(current=current,
                                                           total=total)
            progress.update(percent, '', msg, '')

            if progress.iscanceled():
                break

            # process here
            p.add_link(url, text)

        progress.close()

        items = [{
            'label': HTMLParser.HTMLParser().unescape(part.text),
            'partnum': num,
            'media': part.media
        } for num, part in sorted(p.parts.items())]

        return items
Ejemplo n.º 24
0
def InstallRepo(path = "0", tracking_string = ""):
	'''
	Cài đặt repo
	Parameters
	----------
	path : string
		Nếu truyền "gid" của Repositories sheet:
			Cài tự động toàn bộ repo trong Repositories sheet
		Nếu truyền link download zip repo
			Download và cài zip repo đó
	tracking_string : string
		 Tên dễ đọc của view
	'''
	GA( # tracking
		"Install Repo - %s" % tracking_string,
		"/install-repo/%s" % path
	)
	if path.isdigit(): # xác định GID
		pDialog = xbmcgui.DialogProgress()
		pDialog.create('Vui lòng đợi','Bắt đầu cài repo','Đang tải...')
		items = getItems(path)
		total = len(items)
		i = 0
		failed = []
		installed = []
		for item in items:
			done = int(100 * i / total)
			pDialog.update(done,'Đang tải', item["label"] + '...')
			if ":/" not in item["label2"]:
				result = xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Addons.GetAddonDetails", "params":{"addonid":"%s", "properties":["version"]}, "id":1}' % item["label"])
				json_result = json.loads(result)
				if "version" in result and version_cmp(json_result["result"]["addon"]["version"], item["label2"]) >= 0:
					pass
				else:
					try:
						item["path"] = "http" + item["path"].split("http")[-1]
						download(urllib.unquote_plus(item["path"]), item["label"])
						installed += [item["label"].encode("utf-8")]
					except:
						failed += [item["label"].encode("utf-8")]
			else:
				if not os.path.exists(xbmc.translatePath(item["label2"])):
					try:
						item["path"] = "http" + item["path"].split("http")[-1]
						download(urllib.unquote_plus(item["path"]), item["label2"])
						installed += [item["label"].encode("utf-8")]
					except:
						failed += [item["label"].encode("utf-8")]


			if pDialog.iscanceled():
				break
			i+=1
		pDialog.close()
		if len(failed) > 0:
			dlg = xbmcgui.Dialog()
			s = "Không thể cài các rep sau:\n[COLOR orange]%s[/COLOR]" % "\n".join(failed)
			dlg.ok('Chú ý: Không cài đủ repo!', s)
		else:
			dlg = xbmcgui.Dialog()
			s = "Tất cả repo đã được cài thành công\n%s" % "\n".join(installed)
			dlg.ok('Cài Repo thành công!', s)

	else: # cài repo riêng lẻ
		try:
			download(path, "")
			dlg = xbmcgui.Dialog()
			s = "Repo %s đã được cài thành công" % tracking_string
			dlg.ok('Cài Repo thành công!', s)
		except:
			dlg = xbmcgui.Dialog()
			s = "Vùi lòng thử cài lại lần sau"
			dlg.ok('Cài repo thất bại!', s)

	xbmc.executebuiltin("XBMC.UpdateLocalAddons()")
	xbmc.executebuiltin("XBMC.UpdateAddonRepos()")
Ejemplo n.º 25
0
 def __init__(self, heading):
     AbstractProgress.__init__(self)
     self.dialog = xbmcgui.DialogProgress()
     self.opened = False
     self.heading = heading
     xbmc.sleep(500)
Ejemplo n.º 26
0
def plays(id):
    dialogWait = xbmcgui.DialogProgress()
    dialogWait.create('ITV Plus', 'Đang tải. Vui lòng chờ trong giây lát...')
    xbmcplugin.set_resolved_url(resolveUrl(id))
    dialogWait.close()
    del dialogWait