Пример #1
0
    def get(self, response, origin_url=""):
        self.found_links = []
        movie = {
            'group': {},
            'episode': [],
            'links': [],
        }
        soup = BeautifulSoup(response, "html.parser")
        posts = soup.select(
            "ol.messageList > li.message > div.messageInfo > div.messageContent > article > blockquote"
        )
        for post in posts:
            self.extract_links(post)

        if len(self.found_links) > 0:
            arequest = AsyncRequest()
            results = arequest.get(self.found_links)
            for idx, result in enumerate(results):
                try:
                    name, size = FShareVN.get_info(content=result)
                except:
                    print('Link die %s' % self.found_links[idx])
                    continue

                if name:
                    movie['links'].append({
                        'link':
                        self.found_links[idx],
                        'title':
                        '[%s] %s' % (size, name),
                        'intro':
                        name,
                        'type':
                        'Unknown',
                        'resolve':
                        False,
                        'isFolder':
                        FShareVN.is_folder(self.found_links[idx]),
                        'originUrl':
                        origin_url
                    })
                else:
                    movie['links'].append({
                        'link':
                        self.found_links[idx],
                        'title':
                        self.found_links[idx],
                        'type':
                        'Unknown',
                        'resolve':
                        False,
                        'isFolder':
                        FShareVN.is_folder(self.found_links[idx]),
                        'originUrl':
                        origin_url
                    })

        return movie
Пример #2
0
def playing_with_fshare_code():
    text = None
    if not plugin.args:
        keyboard = xbmc.Keyboard('', 'Input fshare code:')
        keyboard.doModal()
        if keyboard.isConfirmed():
            text = keyboard.getText()
    else:
        text = plugin.args.get('query')[0]

    if not text:
        return

    is_folder = False
    title, size = Fshare.get_asset_info(code=text.strip().upper())

    if size == 0:
        url = 'https://fshare.vn/folder/{}'.format(text.strip().upper())
        is_folder = True
        size = 'Folder'
    else:
        url = 'https://fshare.vn/file/{}'.format(text.strip().upper())

    movie = {
        'resolve': False,
        'link': url,
        'title': title,
        'realtitle': title,
        'size': size,
        'is_folder': is_folder
    }
    helper.save_last_fshare_movie(movie, 'fshare-watched.json')
    return
Пример #3
0
    def get(self, response, skipEps=False):
        movie = {
            'group': {},
            'episode': [],
            'links': [],
        }
        soup = BeautifulSoup(response, "html.parser")
        # get all server list
        servers = soup.select("ul.ipsDataList > div#extraFields > li")

        # get subtitle link
        subtitle = None
        try:
            subtitle = soup.select_one("ul.ipsDataList > div#extraFields > li a.ipsType_success").get('href')
        except:
            pass

        server = servers[-1:][0]
        items = server.select('span.ipsDataItem_main a')

        links = []
        for link in items:
            f_url = 'https://www.fshare.vn/api/v3/files/folder?linkcode=%s' % FShareVN.extract_code(link.get('href'))
            if link and 'fshare' in link.get('href'): links.append(f_url)

        if len(links) > 0:
            results = AsyncRequest().get(links)
            for idx, result in enumerate(results):
                try:
                    link = items[idx].get('href')
                    name, size = FShareVN.get_asset_info(content=result)
                    movie['links'].append({
                        'link': link,
                        'title': '[%s] %s' % (size, name),
                        'type': 'Fshare',
                        'isFolder': FShareVN.is_folder(link),
                        'subtitle': subtitle,
                        'resolve': False
                    })
                except:
                    print('Link die %s' % items[idx].get('href'))
                    continue

        return movie
Пример #4
0
    def extract_links(self, content):
        allow_url = ['fshare.vn/']

        for link in content.select('a.externalLink'):
            url = link.get('href')
            if True in map(lambda x: x in url,
                           allow_url) and url not in self.found_links:
                self.found_links.append(url)
                self.info_links.append(
                    'https://www.fshare.vn/api/v3/files/folder?linkcode=%s' %
                    FShareVN.extract_code(url))
Пример #5
0
    def get(self, response, skipEps=False):
        movie = {
            'group': {},
            'episode': [],
            'links': [],
        }
        soup = BeautifulSoup(response, "html.parser")
        # get all server list
        servers = soup.select("ul.ipsDataList > div#extraFields > li")

        # get subtitle link
        subtitle = None
        try:
            subtitle = soup.select_one(
                "ul.ipsDataList > div#extraFields > li a.ipsType_success").get(
                    'href')
        except:
            pass

        server = servers[-1:][0]
        items = server.select('> span.ipsDataItem_main a')

        links = []
        for link in items:
            if link and 'fshare' in link.get('href'):
                links.append(link.get('href'))

        if len(links) > 0:
            results = AsyncRequest().get(links)
            for idx, result in enumerate(results):
                try:
                    name, size = FShareVN.get_info(content=result)
                    movie['links'].append({
                        'link': links[idx],
                        'title': '[%s] %s' % (size, name),
                        'type': 'Unknown',
                        'subtitle': subtitle,
                        'resolve': False
                    })
                except:
                    print('Link die %s' % links[idx])
                    continue

        return movie