예제 #1
0
def _login():
    logged_in = False
    while not logged_in:
        try:
            client = XBMCMailClient(
                username=plugin.get_setting('username', unicode),
                password=plugin.get_setting('password', unicode),
                host=plugin.get_setting('imap_host', unicode),
                use_ssl=plugin.get_setting('use_ssl', bool),
            )
        except InvalidCredentials:
            try_again = xbmcgui.Dialog().yesno(_('connection_error'),
                                               _('wrong_credentials'),
                                               _('want_set_now'))
            if not try_again:
                return
            plugin.open_settings()
        except InvalidHost:
            try_again = xbmcgui.Dialog().yesno(_('connection_error'),
                                               _('wrong_host'),
                                               _('want_set_now'))
            if not try_again:
                return
            plugin.open_settings()
        else:
            logged_in = True
    return client
예제 #2
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'))
예제 #3
0
def people_list_show_people(id, source, fanart):
    items = []
    try:
        if source == "imdb":
            people = trakt.get_show_people(id)
        else:
            xbmcgui.Dialog().ok("Error", "No cast info found")
            return plugin.finish(items=[])
    except:
        xbmcgui.Dialog().ok("Error", "No cast info found")
        return plugin.finish(items=[])
    if "cast" in people:
        for actor in people["cast"]:
            context_menu = [
                (
                    "Convert to bob_xml",
                    "RunPlugin({0})".format(
                        plugin.url_for("bob_convert_person_to_xml", trakt_id=actor["person"]["ids"]["trakt"]))
                )
            ]
            image = get_person_artwork(actor)
            label = "{0} ({1})".format(to_utf8(actor["person"]["name"]), to_utf8(actor["character"]))
            info = actor["person"]["biography"]
            items.append({'label': label,
                          'path': plugin.url_for("people_list_person_select", id=actor["person"]["ids"]["trakt"],
                                                 name=to_utf8(actor["person"]["name"])),
                          'info': info,
                          'thumbnail': image,
                          'poster': image,
                          'context_menu': context_menu,
                          'icon': "DefaultVideo.png",
                          'properties': {'fanart_image': fanart},
                          })
        return plugin.finish(items=items)
예제 #4
0
def play_movie(menuid, page, videoid):
    '''
    Resolve video url
    '''
    plugin.log.debug('Get movie')

    page_url = plugin.request.args['url'][0]
    url = api.get_movie(page_url)

    print 'resolve video: {url}'.format(url=url)
    plugin.log.debug('resolve video: {url}'.format(url=url))

    if url:
        media = __resolve_item(url, videoid)

        print 'resolved to: {url}'.format(url=media)

        if media:
            plugin.set_resolved_url(media)
        else:
            msg = ['cannot play video stream']
            plugin.log.error(msg[0])
            dialog = xbmcgui.Dialog()
            dialog.ok(api.long_name, *msg)
    else:
        msg = ['video url not found']
        plugin.log.error(msg[0])
        dialog = xbmcgui.Dialog()
        dialog.ok(api.long_name, *msg)
예제 #5
0
    def check_for_update(self, ignore_checked=False):
        update_storage = self.plugin.get_storage('update', TTL=24 * 60)
        update = None

        if not update_storage.get('checked') or ignore_checked:
            response = json.load(urllib2.urlopen(self.api_url))
            for release in response:
                if re.match(self.regexp, release['tag_name'].strip(
                        'v')).group() > self.current_version:
                    update = Update()
                    print self.current_version
                    update.current_version = self.current_version
                    update.update_version = re.match(
                        self.regexp, release['tag_name'].strip('v')).group()
                    update.asset_url = release['assets'][0][
                        'browser_download_url']
                    update.asset_name = release['assets'][0]['name']
                    update.changelog = release['body']
                    update.file_path = os.path.join(self.plugin.storage_path,
                                                    update.asset_name)

            update_storage['checked'] = True
            update_storage.sync()

            if update is not None:
                xbmcgui.Dialog().notification(
                    self.core.string('name'),
                    self.core.string('update_available') %
                    update.update_version)
                return update
            else:
                xbmcgui.Dialog().notification(
                    self.core.string('name'),
                    self.core.string('no_update_available'))
                return None
def resolve_movie(menuid, page, movieid, linkid):
    '''
    Play movie
    '''
    page_url = plugin.request.args['url'][0]
    url = api.resolve_redirect(page_url)

    print 'resolve video: {url}'.format(url=url)
    plugin.log.debug('resolve video: {url}'.format(url=url))

    if url:
        media = __resolve_item(url, movieid)

        print 'resolved to: {url}'.format(url=media)

        if media:
            plugin.set_resolved_url(media)
        else:
            msg = ['cannot play video stream']
            plugin.log.error(msg[0])
            dialog = xbmcgui.Dialog()
            dialog.ok(api.LONG_NAME, *msg)
    else:
        msg = ['video url not found']
        plugin.log.error(msg[0])
        dialog = xbmcgui.Dialog()
        dialog.ok(api.LONG_NAME, *msg)
예제 #7
0
def download_vid(sid, season, ep, title, quality):
    dp = plugin.get_setting('download_path')
    if not dp:
        dp = xbmcgui.Dialog().browse(3, 'בחר תיקיית הורדות', 'files', '', False, False, '')
        if not dp:
            plugin.notify('אנא בחרו יעד להורדת הפרק', image=ICON)
            return
    plugin.set_setting('download_path', dp)

    plugin.notify('מכין הורדה..', image=ICON)
    qualities, cookie = sdarot.get_final_video_and_cookie(sid, season, ep, choose_quality=True, download=True)

    if quality == 'None':
        q_dialog = xbmcgui.Dialog()
        q_list = list(qualities.keys())
        q_index = q_dialog.select('בחר איכות', q_list)
        if q_index == -1:
            return
        quality = q_list[q_index]
    url = qualities[quality]
    if url and cookie:
        url = sdarot.get_ip_url(url)
        def download():
            with open(dp + '{0}.S{1}.E{2}_{3}.mp4'.format(title.replace(' ', '.').replace('/', '-'), season, ep, quality + 'P'), 'wb') as f:
                download_headers = {  # Required for download speed
                    'Accept-Encoding': 'gzip, deflate, br',
                    'Cache-Control': 'no-cache',
                    'Connection': 'keep-alive',
                    'User-Agent': HEADERS['User-Agent']
                    ,'Cookie': 'Sdarot={0}'.format(cookie.get('Sdarot'), safe='')
                }

                request = urllib2.Request('http:' + url, headers=download_headers)
                response = urllib2.urlopen(request)
                total_size = response.info().get('Content-Length')

                plugin.notify('ההורדה החלה', image=ICON)

                dialog = xbmcgui.DialogProgressBG()
                dialog.create(f.name)
                dialog.update(1)
                dl = 0

                while True:
                    chunk = response.read(1024 * 30)
                    if not chunk:
                        break
                    dl += len(chunk)
                    dialog.update(100 * dl / int(total_size))
                    f.write(chunk)

                dialog.close()
                response.close()

            plugin.notify('{0} עונה {1} פרק {2} ירד בהצלחה!'.format(title, season, ep), delay=8000, image=ICON)
            return True

        thr = threading.Thread(target=download)
        thr.start()
예제 #8
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()")
예제 #9
0
def gomtv_login():
    userid = plugin.get_setting('account', unicode)
    password = plugin.get_setting('password', unicode)
    if not userid or not password:
        xbmcgui.Dialog().ok(_L(30010), _L(30011))
        return False
    if not gomm.login(userid, password):
        xbmcgui.Dialog().ok(_L(30010), _L(30012))
        return False
    plugin.notify(_L(30014), title=plugin.name)
    return True
예제 #10
0
파일: addon.py 프로젝트: camster1/RTOTV
def get_download_path(setting_name):
    download_path = plugin.get_setting(setting_name, str)
    while not download_path:
        try_again = xbmcgui.Dialog().yesno(_('no_download_path'),
                                           _('want_set_now'))
        if not try_again:
            return
        download_path = xbmcgui.Dialog().browse(
            3,  # ShowAndGetWriteableDirectory
            _('choose_download_folder'),
            'music',
        )
        plugin.set_setting(setting_name, download_path)
    return download_path
예제 #11
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()
예제 #12
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()
예제 #13
0
def get_players(media, filters={}):
    assert media in ("tvshows", "movies", "musicvideos", "music", "live")
    players = []
    players_path = "special://home/userdata/addon_data/{0}/players/".format(
        plugin.id)
    files = [
        x for x in xbmcvfs.listdir(players_path)[1] if x.endswith(EXTENSION)
    ]
    for file in files:
        path = players_path + file
        try:
            f = xbmcvfs.File(path)
            try:
                content = f.read()
                meta = json.loads(content)
            finally:
                f.close()
            player = AddonPlayer(file, media, meta)
            if not player.is_empty():
                players.append(player)
        except Exception, e:
            plugin.log.error(repr(e))
            msg = "player %s is invalid" % file
            xbmcgui.Dialog().ok('Invalid player', msg)
            raise
예제 #14
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)
예제 #15
0
def people_list_person_select(id, name):
    selection = xbmcgui.Dialog().select("show {0}'s:".format(name),
                                        ["movies", "shows"])
    if selection == 0:
        people_list_person_movies(id)
    elif selection == 1:
        people_list_person_shows(id)
예제 #16
0
파일: default.py 프로젝트: vinhcomp/xml
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
예제 #17
0
def AddPlaylist(tracking_string="Add Playlist"):
    sheet_url = plugin.keyboard(
        heading=
        'Nhập URL của Google Spreadsheet (có hỗ trợ link rút gọn như bit.ly, goo.gl)'
    )
    if sheet_url:
        try:
            resp, content = http.request(sheet_url, "HEAD")
            sid, gid = re.compile("/d/(.+?)/.+?gid=(\d+)").findall(
                resp["content-location"])[0]
            match_passw = re.search('passw=(.+?)($|&)',
                                    resp["content-location"])
            playlists = plugin.get_storage('playlists')
            name = plugin.keyboard(heading='Đặt tên cho Playlist')

            item = "[[COLOR yellow]%s[/COLOR]] %s@%s" % (name, gid, sid)
            if match_passw:
                item += "@@" + match_passw.group(1)
            if 'sections' in playlists:
                playlists["sections"] = [item] + playlists["sections"]
            else:
                playlists["sections"] = [item]
            xbmc.executebuiltin('Container.Refresh')
        except:
            line1 = "Vui lòng nhập URL hợp lệ. Ví dụ dạng đầy đủ:"
            line2 = "http://docs.google.com/spreadsheets/d/xxx/edit#gid=###"
            line3 = "Hoặc rút gọn: http://bit.ly/xxxxxx hoặc http://goo.gl/xxxxx"
            dlg = xbmcgui.Dialog()
            dlg.ok("URL không hợp lệ!!!", line1, line2, line3)
예제 #18
0
def select_torrent_link(series_id,
                        season_number,
                        episode_number,
                        select_quality=False):
    dom_parser = get_dom_parser()
    links = dom_parser.get_torrent_links(series_id, season_number,
                                         episode_number)

    qualities = sorted(Quality)
    quality = plugin.get_setting('quality', int)

    ordered_links = [
        next((l for l in links if l.quality == q), None) for q in qualities
    ]

    if not quality or select_quality or not ordered_links[quality - 1]:
        filtered_links = [l for l in ordered_links if l]
        if not filtered_links:
            return
        options = [
            "%s / %s" %
            (tf.color(l.quality.localized, 'white'), tf.human_size(l.size))
            for l in filtered_links
        ]
        res = xbmcgui.Dialog().select(plugin.get_string(40400), options)
        if res < 0:
            return
        return filtered_links[res]
    else:
        return ordered_links[quality - 1]
def get_api():
    logged_in = False
    api = TraktListApi()
    while not logged_in:
        try:
            token = api.connect(
                username=plugin.get_setting('username', unicode),
                password=plugin.get_setting('password', unicode),
                token=plugin.get_setting('trakt_token', unicode),
                api_key=API_KEY,
                use_https=plugin.get_setting('use_https', bool),
            )
            plugin.set_setting('trakt_token', token)
            logged_in = True
        except AuthenticationError:
            token = ''

        if not token:
            try_again = xbmcgui.Dialog().yesno(_('connection_error'),
                                               _('wrong_credentials'),
                                               _('want_set_now'))
            if not try_again:
                return
            plugin.open_settings()
    return api
예제 #20
0
def changeList(url):
    html = get_html(url)
    tree = BeautifulSoup(html, 'html.parser')
    soup = tree.find_all('div', {'class': 'm-tag-type'})

    surl = url.split('/')
    purl = surl[-1].split('-')

    dialog = xbmcgui.Dialog()

    filter = ''
    for iclass in soup:
        title = iclass.find('h5', {'class': 'u-title'}).text
        si = iclass.find_all('a')
        list = []
        for subitem in si:
            list.append(subitem.text)
        sel = dialog.select(title, list)

        if sel < 0:
            continue

        filter += u'|' + title + u'(' + si[sel].text + u')'
        seurl = si[sel]['onclick'].split('/')[-1]
        seurl = seurl.split('-')

        for i in range(0, len(purl)):
            if seurl[i] != '':
                purl[i] = seurl[i]

    surl[-1] = '-'.join(purl)
    url = '/'.join(surl)
    mainlist(url, filter)
예제 #21
0
def ask_provider():
    providers = [
        {
            'name': 'Custom',
            'imap_host': '',
            'smtp_host': ''
        },
        {
            'name': '1und1.de',
            'imap_host': 'imap.1und1.de',
            'smtp_host': 'smtp.1und1.de',
            'use_ssl': 'true'
        },
        {
            'name': 'Arcor.de',
            'imap_host': 'imap.arcor.de',
            'smtp_host': 'smtp.arcor.de',
            'use_ssl': 'true'
        },
        {
            'name': 'Freenet.de',
            'imap_host': 'mx.freenet.de',
            'smtp_host': 'mx.freenet.de',
            'use_ssl': 'false'
        },
        {
            'name': 'Gmail.com',
            'imap_host': 'imap.gmail.com',
            'smtp_host': 'smtp.gmail.com',
            'use_ssl': 'true'
        },
        {
            'name': 'iCloud.com',
            'imap_host': 'imap.mail.me.com',
            'smtp_host': 'smtp.mail.me.com',
            'use_ssl': 'true'
        },
        {
            'name': 'T-Online.de',
            'imap_host': 'secureimap.t-online.de',
            'smtp_host': 'securesmtp.t-online.de',
            'use_ssl': 'true'
        },
        {
            'name': 'Web.de',
            'imap_host': 'imap.web.de',
            'smtp_host': 'smtp.web.de',
            'use_ssl': 'false'
        },
        {
            'name': 'Yahoo.com',
            'imap_host': 'imap.mail.yahoo.com',
            'smtp_host': 'smtp.mail.yahoo.com',
            'use_ssl': 'true'
        },
    ]
    selected = xbmcgui.Dialog().select(_('select_provider'),
                                       [p['name'] for p in providers])
    if selected >= 0:
        return providers[selected]
예제 #22
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
예제 #23
0
def play_file(infohash, path):
    client = get_client()
    
    files = client.call('core.get_torrent_status', infohash, ['name', 'num_files', 'files', 'save_path', 'file_progress'])
    for progress, f in zip(files['file_progress'], files['files']):
        if f['path'] != path:
            continue
        
        if progress != 1.0:
            continue
        
        full_path = os.path.join(files['save_path'], f['path'])
        if os.path.isfile(full_path):
            name = path.split('/')[-1]
            item = {
                'label': name,
                'path': full_path,
            }
    
    if 'streaming.stream_torrent' not in client.call('daemon.get_method_list'):
        dialog = xbmcgui.Dialog()
        dialog.ok(plugin.get_string(31000), plugin.get_string(31001))
        return
    
    result = client.call('streaming.stream_torrent', infohash=infohash, filepath_or_index=path, includes_name=True, wait_for_end_pieces=True)
    name = path.split('/')[-1]
    item = {
        'label': name,
        'path': result['url'],
    }
    return plugin.play_video(item)
예제 #24
0
def IIi1IiiiI1Ii():
    I11i11Ii("None", "None")
    oO00oOo = xbmc.translatePath(
        xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
    oO00oOo = xbmc.translatePath(os.path.join(oO00oOo, "temp.jpg"))
    # urllib . urlretrieve ( 'https://googledrive.com/host/0B-ygKtjD8Sc-S04wUUxMMWt5dmM/images/anhtrang.jpg' , oO00oOo )
    # OOOo0 = xbmcgui . ControlImage ( 0 , 0 , 1280 , 720 , oO00oOo )
    # Oooo000o = xbmcgui . WindowDialog ( )
    # Oooo000o . addControl ( OOOo0 )
    # Oooo000o . doModal ( )
    # IiIi11iIIi1Ii = ""
    # Oo0O = ( "Busy" , "Bận" , "Band" , "Beschäftigt" , "Bezig" , "忙" , "忙碌" )
    # while True :
    # IiI = urllib . quote ( xbmc . getInfoLabel ( "System.KernelVersion" ) . strip ( ) )
    # if not any ( b in IiI for b in Oo0O ) : break
    # while True :
    # ooOo = urllib . quote ( xbmc . getInfoLabel ( "System.FriendlyName" ) . strip ( ) )
    # if not any ( b in ooOo for b in Oo0O ) : break
    # try :
    # IiIi11iIIi1Ii = open ( '/sys/class/net/eth0/address' ) . read ( ) . strip ( )
    # except :
    # while True :
    # IiIi11iIIi1Ii = xbmc . getInfoLabel ( "Network.MacAddress" ) . strip ( )
    # if re . match ( "[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$" , IiIi11iIIi1Ii . lower ( ) ) : break
    # Oo = urllib2 . urlopen ( "http://www.viettv24.com/main/checkActivation.php?MacID=%s&app_id=%s&sys=%s&dev=%s" % ( IiIi11iIIi1Ii , "2" , IiI , ooOo ) ) . read ( )
    if True:
        o0O = [{
            'label':
            'Phim mới',
            'path':
            '%s/latest/%s/%s' %
            (ii,
             urllib.quote_plus(
                 'http://phim.anhtrang.org/danh-sach/new/trang-%s.html'), 1)
        }, {
            'label':
            'Phim HD',
            'path':
            '%s/hd/%s/%s' %
            (ii,
             urllib.quote_plus(
                 'http://phim.anhtrang.org/danh-sach/phim-hd/trang-%s.html'),
             1)
        }, {
            'label': 'Thể loại',
            'path': '%s/genres' % ii
        }, {
            'label': 'Quốc gia',
            'path': '%s/nations' % ii
        }, {
            'label': 'Tìm kiếm',
            'path': '%s/search' % ii
        }]
        return oo000.finish(o0O)
    else:
        IiiIII111iI = xbmcgui.Dialog()
        IiiIII111iI.ok("Chú ý", Oo)
        if 34 - 34:
            iii1I1I / O00oOoOoO0o0O.O0oo0OO0 + Oo0ooO0oo0oO.I1i1iI1i - II
        if 100 - 100: i11Ii11I1Ii1i.ooO - OOoO / ooo0Oo0 * i1 - OOooo0000ooo
예제 #25
0
def select(url, filter):
    html = get_html(httphead(url))
    tree = BeautifulSoup(html, 'html.parser')
    soup = tree.find_all('div', {'class': 'td__category__filter__panel__item'})

    dialog = xbmcgui.Dialog()
    color = '[COLOR FF00FF00]%s[/COLOR]'
    for item in soup:
        if filter != item.label.text.encode('utf-8'):
            continue
        si = item.find_all('li')
        list = []
        i = 0
        for subitem in si:
            title = subitem.text
            if 'current' in subitem.get('class', ''):
                title = '[B]{}[/B]'.format(title.encode('utf-8'))
                mark = i
            list.append(title)
            i += 1
        sel = dialog.select(item.label.text, list)

        if sel >= 0:
            url = si[sel].a['href']
    return videolist(url.encode('utf-8'))
예제 #26
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)
def download_video(source, url):
    import SimpleDownloader
    sd = SimpleDownloader.SimpleDownloader()
    playable_url = _get_playable_url(source, url)
    if source == 'apple.com':
        sd.common.USERAGENT = 'QuickTime'
        playable_url = playable_url.split('|')[0]
    elif source == 'youtube.com':
        plugin.notify(msg=_('download_not_possible'))
        return
    download_path = plugin.get_setting('download_path')
    while not download_path:
        try_again = xbmcgui.Dialog().yesno(_('no_download_path'),
                                           _('want_set_now'))
        if not try_again:
            return
        plugin.open_settings()
        download_path = plugin.get_setting('download_path')
    filename = playable_url.split('?')[0].split('/')[-1]
    if filename == 'makeplaylist.dll':
        filename = playable_url.split('=')[-1]  # yahoo...
    params = {'url': playable_url, 'download_path': download_path}
    sd.download(filename, params)
    downloads = plugin.get_storage('downloads')
    downloads[url] = xbmc.translatePath(download_path + filename)
    downloads.sync()
예제 #28
0
파일: gameinfo.py 프로젝트: rusguliev/Luna
 def select_fanart(self):
     browser = xbmcgui.Dialog().browse(
         2, 'Select Fanart', 'files', '.jpg|.png', False, False,
         self.game.get_selected_fanart().get_thumb())
     if browser:
         self.game.set_selected_fanart(browser)
         self.core.get_storage().sync()
def show_help():
    xbmcgui.Dialog().ok(
        _('help_head'),
        _('help_l1'),
        _('help_l2'),
        _('help_l3'),
    )
예제 #30
0
def filter(url):
    html = get_html(url)
    tree = BeautifulSoup(html, 'html.parser')
    soup = tree.find_all('div', {'class': 'list_nav'})
    dialog = xbmcgui.Dialog()

    urlsplit = url.split('/')
    urltype = re.compile('\w{1}.+?_').findall(urlsplit[-1])
    marktype = []
    for item in soup:
        typelist = item.span.text
        title = re.sub('\r|\n|\t| ', '', typelist)
        li = item.findAll('li')
        sel = dialog.select(title, [x.text for x in li])

        if sel >= 0:
            if 'href' not in li[sel]: li[sel]['href'] = url
            selurl = li[sel]['href'].split('/')
            seltype = re.compile('\w{1}.+?_').findall(selurl[-1])
            for i in seltype:
                if i not in urltype:
                    marktype.append(i)

    u1 = urlsplit[-1]
    for type in marktype:
        u1 = re.sub(type[0] + '.+?_', type, u1)
    urlsplit[-1] = u1
    url = '/'.join(urlsplit)
    return videolist(url=url, page=1)