• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python dom_parser2.parse_dom函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中resources.lib.modules.dom_parser2.parse_dom函数的典型用法代码示例。如果您正苦于以下问题:Python parse_dom函数的具体用法?Python parse_dom怎么用?Python parse_dom使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了parse_dom函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: sources

 def sources(self, url, hostDict, hostprDict):
     try:
         sources = []          
         r = client.request(url)
         r = dom_parser2.parse_dom(r, 'div', {'class': 'tab_box'})[0]
         r = dom_parser2.parse_dom(r.content, 'iframe', req='src')[0]
         url = r.attrs['src']
         if r:
             try:
                 host = re.findall('([\w]+[.][\w]+)$', urlparse.urlparse(url.strip().lower()).netloc)[0]
                 if host in hostDict:
                     host = client.replaceHTMLCodes(host)
                     host = host.encode('utf-8')
                     sources.append({
                         'source': host,
                         'quality': 'SD',
                         'language': 'en',
                         'url': url.replace('\/','/'),
                         'direct': False,
                         'debridonly': False
                     })
             except: pass
         return sources
     except Exception:
         return
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:25,代码来源:moviego.py


示例2: episode

 def episode(self, url, imdb, tvdb, title, premiered, season, episode):
     try:
         if url == None: return
         url = urlparse.parse_qs(url)
         url = dict([(i, url[i][0]) if url[i] else (i, '') for i in url])
         url['premiered'], url['season'], url['episode'] = premiered, season, episode
         try:
             clean_title = cleantitle.geturl(url['tvshowtitle'])+'-season-%d' % int(season)
             search_url = urlparse.urljoin(self.base_link, self.search_link % clean_title.replace('-', '+'))
             r = self.scraper.get(search_url).content
             r = dom_parser2.parse_dom(r, 'li', {'class': 'item'})
             r = [(dom_parser2.parse_dom(i, 'a', attrs={'class': 'title'}),
                   dom_parser2.parse_dom(i, 'div', attrs={'class':'status'})[0]) for i in r if i]
             r = [(i[0][0].attrs['href'], re.findall('(.+?)</b><br', i[0][0].content, re.DOTALL)[0],
                   re.findall('(\d+)', i[1].content)[0]) for i in r if i]
             r = [(i[0], i[1].split(':')[0], i[2]) for i in r
                  if (cleantitle.get(i[1].split(':')[0]) == cleantitle.get(url['tvshowtitle']) and i[2] == str(int(season)))]
             url = r[0][0]
         except:
             pass
         data = self.scraper.get(url).content
         data = client.parseDOM(data, 'div', attrs={'id': 'details'})
         data = zip(client.parseDOM(data, 'a'), client.parseDOM(data, 'a', ret='href'))
         url = [(i[0], i[1]) for i in data if i[0] == str(int(episode))]
         return url[0][1]
     except:
         return
开发者ID:vphuc81,项目名称:MyRepository,代码行数:27,代码来源:kattv.py


示例3: sources

 def sources(self, url, hostDict, hostprDict):
     try:
         sources = []          
         r = client.request(url)
         r = dom_parser2.parse_dom(r, 'div', {'id': re.compile('option-\d+')})
         r = [dom_parser2.parse_dom(i, 'iframe', req=['src']) for i in r if i]
         r = [(i[0].attrs['src']) for i in r if i]
         if r:
             for url in r:
                 try:
                     host = re.findall('([\w]+[.][\w]+)$', urlparse.urlparse(url.strip().lower()).netloc)[0]
                     if host in hostDict:
                         host = client.replaceHTMLCodes(host)
                         host = host.encode('utf-8')
                         sources.append({
                             'source': host,
                             'quality': 'SD',
                             'language': 'en',
                             'url': url.replace('\/','/'),
                             'direct': False,
                             'debridonly': False
                         })
                 except: pass
         return sources
     except Exception:
         return
开发者ID:vphuc81,项目名称:MyRepository,代码行数:26,代码来源:rjsmovie.py


示例4: episode

    def episode(self, url, imdb, tvdb, title, premiered, season, episode):
        try:
            if not url:
                return

            sep = '%dx%02d' % (int(season), int(episode))
            r = client.request(url, headers=self.headers)
            r = dom_parser2.parse_dom(r, 'span', attrs={'class': 'list'})
            r1 = dom_parser2.parse_dom(r, 'br')
            r1 = [dom_parser2.parse_dom(i, 'a', req='href') for i in r1]
            try:
                if int(season) == 1 and int(episode) == 1:
                    url = dom_parser2.parse_dom(r, 'a', req='href')[1].attrs['href']
                else:
                    for i in r1:
                        if sep in i[0].content:
                            url = urlparse.urljoin(self.base_url, i[0].attrs['href'])
            except:
                pass
            url = url[:-1]
            url = url.split('?v=')[1]
            url = self.list_url % url
            return url
        except:
            failure = traceback.format_exc()
            log_utils.log('IceFilms - Exception: \n' + str(failure))
            return
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:27,代码来源:icefilms.py


示例5: sources

 def sources(self, url, hostDict, hostprDict):
     try:
         sources = []
         for u in url:
             hostDict += [('clicknupload.org')]
             quality = '1080p' if '-1080p' in u or 'bluray-2' in u else '720p' if '-720p' in u or 'bluray' in u else 'SD'
             
             r = client.request(u)
             r = dom_parser2.parse_dom(r, 'ul', {'class': 'download-links'})
             r = dom_parser2.parse_dom(r, 'a', req=['href'])
             r = [i.attrs['href'] for i in r if i]
             for i in r:
                 try:
                     valid, host = source_utils.is_host_valid(i, hostDict)
                     if not valid: continue
                     sources.append({
                         'source': host,
                         'quality': quality,
                         'language': 'en',
                         'url': i,
                         'direct': False,
                         'debridonly': False
                     })
                 except: pass
         return sources
     except Exception:
         return
开发者ID:CYBERxNUKE,项目名称:xbmc-addon,代码行数:27,代码来源:savaze.py


示例6: sources

    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []
            if url is None:
                return sources

            r = client.request(url)
            quality = re.findall(">(\w+)<\/p", r)
            if quality[0] == "HD":
                quality = "720p"
            else:
                quality = "SD"
            r = dom_parser2.parse_dom(r, 'div', {'id': 'servers-list'})
            r = [dom_parser2.parse_dom(i, 'a', req=['href']) for i in r if i]

            for i in r[0]:
                url = {
                    'url': i.attrs['href'],
                    'data-film': i.attrs['data-film'],
                    'data-server': i.attrs['data-server'],
                    'data-name': i.attrs['data-name']}
                url = urllib.urlencode(url)
                sources.append({'source': i.content, 'quality': quality, 'language': 'en',
                                'url': url, 'direct': False, 'debridonly': False})
            return sources
        except Exception:
            failure = traceback.format_exc()
            log_utils.log('FreePutlockers - Exception: \n' + str(failure))
            return sources
开发者ID:vphuc81,项目名称:MyRepository,代码行数:29,代码来源:Fantastic+(11).py


示例7: episode

 def episode(self, url, imdb, tvdb, title, premiered, season, episode):
     try:
         if not url: return
         sep = '%dx%02d' % (int(season), int(episode))
         r = self.scraper.get(url).content
         if 'To proceed, you must allow popups' in r:
             for i in range(0, 5):
                 r = self.scraper.get(url).content
                 if 'To proceed, you must allow popups' not in r: break    
         r = dom_parser2.parse_dom(r, 'span', attrs={'class': 'list'})
         r1 = dom_parser2.parse_dom(r, 'br')
         r1 = [dom_parser2.parse_dom(i, 'a', req='href') for i in r1]
         try:
             if int(season) == 1 and int(episode) == 1:
                 url = dom_parser2.parse_dom(r, 'a', req='href')[1].attrs['href']
             else:
                 for i in r1:
                     if sep in i[0].content:
                         url = urlparse.urljoin(self.base_link, i[0].attrs['href'])
         except:
             pass
         url = url[:-1]
         url = url.split('?v=')[1]
         url = self.list_url % url
         return url
     except:
         return
开发者ID:vphuc81,项目名称:MyRepository,代码行数:27,代码来源:icefilmsis.py


示例8: sources

 def sources(self, url, hostDict, hostprDict):
     try:
         sources = []          
         r = client.request(url)
         r = dom_parser2.parse_dom(r, 'p', {'class': 'server_play'})
         r = [dom_parser2.parse_dom(i, 'a', req=['href']) for i in r if i]
         r = [(i[0].attrs['href'], re.search('/(\w+).html', i[0].attrs['href'])) for i in r if i]
         r = [(i[0], i[1].groups()[0]) for i in r if i[0] and i[1]]
         for i in r:
             try:
                 host = i[1]
                 if str(host) in str(hostDict):
                     host = client.replaceHTMLCodes(host)
                     host = host.encode('utf-8')
                     sources.append({
                         'source': host,
                         'quality': 'SD',
                         'language': 'en',
                         'url': i[0].replace('\/','/'),
                         'direct': False,
                         'debridonly': False
                     })
             except: pass
         return sources
     except Exception:
         return
开发者ID:varunrai,项目名称:repository.magicality,代码行数:26,代码来源:1123movies.py


示例9: movie

    def movie(self, imdb, title, localtitle, aliases, year):
        try:
            clean_title = cleantitle.geturl(title)
            search_url = self.search_link % (clean_title.replace('-','+'), year)
            headers = {'Host': 'http://icefilms1.unblocked.sh',
                       'Cache-Control': 'max-age=0',
                        'Connection': 'keep-alive',
                        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36',
                        'Upgrade-Insecure-Requests': '1',
                        'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
                        'Accept-Encoding': 'gzip, deflate, br',
                        'Accept-Language': 'en-US,en;q=0.8'}

            r = client.request(search_url, headers=headers)
            r = dom_parser2.parse_dom(r, 'td')
            r = [dom_parser2.parse_dom(i, 'a', req='href') for i in r if "<div class='number'" in i.content]
            r = [(urlparse.urljoin(self.base_url, i[0].attrs['href'])) for i in r if title.lower() in i[0].content.lower() and year in i[0].content]
            url = r[0]
            url = url[:-1]
            url = url.split('?v=')[1]
            url = self.list_url % url
            return url
        except:
            failure = traceback.format_exc()
            log_utils.log('IceFilms - Exception: \n' + str(failure))
            return
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:26,代码来源:icefilms.py


示例10: sources

    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []
            if url == None: return sources
            r = client.request(url)
            r = dom_parser2.parse_dom(r, 'div', {'class': 'll-item'})
            r = [(dom_parser2.parse_dom(i, 'a', req='href'), \
                  dom_parser2.parse_dom(i, 'div', {'class': 'notes'})) \
                  for i in r if i]
            r = [(i[0][0].attrs['href'], i[0][0].content, i[1][0].content if i[1] else 'None') for i in r]
            for i in r:
                try:
                    url = i[0]
                    url = client.replaceHTMLCodes(url)
                    url = url.encode('utf-8')
                    valid, host = source_utils.is_host_valid(i[1], hostDict)
                    if not valid: continue
                    host = client.replaceHTMLCodes(host)
                    host = host.encode('utf-8')
                    
                    info = []
                    quality, info = source_utils.get_release_quality(i[2], i[2])

                    info = ' | '.join(info)
                    sources.append({'source': host, 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': False})
                except:
                    pass

            return sources
        except:
            return sources
开发者ID:vphuc81,项目名称:MyRepository,代码行数:31,代码来源:weseries.py


示例11: sources

    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []

            if url == None: return sources

            if debrid.status() is False: raise Exception()

            data = urlparse.parse_qs(url)
            data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data])

            title = data['title'].replace(':','').lower()
            year = data['year']

            query = '%s %s' % (data['title'], data['year'])
            query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query)

            url = urlparse.urljoin(self.base_link, self.post_link)

            post = 'do=search&subaction=search&search_start=0&full_search=0&result_from=1&story=%s' % urllib.quote_plus(query)

            r = client.request(url, post=post)
            r = client.parseDOM(r, 'div', attrs={'class': 'box-out margin'})
            r = [(dom_parser2.parse_dom(i, 'div', attrs={'class':'news-title'})) for i in r if data['imdb'] in i]
            r = [(dom_parser2.parse_dom(i[0], 'a', req='href')) for i in r if i]
            r = [(i[0].attrs['href'], i[0].content) for i in r if i]

            hostDict = hostprDict + hostDict

            for item in r:
                try:
                    name = item[1]
                    y = re.findall('\((\d{4})\)', name)[0]
                    if not y == year: raise Exception()

                    s = re.findall('((?:\d+\.\d+|\d+\,\d+|\d+)\s*(?:GB|GiB|Gb|MB|MiB|Mb))', name)
                    s = s[0] if s else '0'
                    data = client.request(item[0])
                    data = dom_parser2.parse_dom(data, 'div', attrs={'id': 'r-content'})
                    data = re.findall('\s*<b><a href=.+?>(.+?)</b>.+?<u><b><a href="(.+?)".+?</a></b></u>',
                                      data[0].content, re.DOTALL)
                    u = [(i[0], i[1], s) for i in data if i]

                    for name, url, size in u:
                        try:
                            if '4K' in name:
                                quality = '4K'
						    elif '2160p' in name:
                                quality = '4K'
							elif '1440p' in name:
                                quality = '4K'
                            elif '1080p' in name:
                                quality = '1080p'
                            elif '720p' in name:
                                quality = '720p'
                            elif any(i in ['dvdscr', 'r5', 'r6'] for i in name):
                                quality = 'SCR'
开发者ID:vphuc81,项目名称:MyRepository,代码行数:57,代码来源:ultrahd.py


示例12: tvshow

 def tvshow(self, imdb, tvdb, tvshowtitle, localtvshowtitle, aliases, year):
     try:
         clean_title = cleantitle.geturl(tvshowtitle)
         search_url = self.search_link % (clean_title.replace('-','+'), year)
         r = client.request(search_url, headers=self.headers)
         r = dom_parser2.parse_dom(r, 'td')
         r = [dom_parser2.parse_dom(i, 'a', req='href') for i in r if "<div class='number'" in i.content]
         r = [(urlparse.urljoin(self.base_url, i[0].attrs['href'])) for i in r if tvshowtitle.lower() in i[0].content.lower() and year in i[0].content]
         url = r[0]
         return url
     except:
         return
开发者ID:amadu80,项目名称:repository.xvbmc,代码行数:12,代码来源:icefilms.py


示例13: movie

 def movie(self, imdb, title, localtitle, aliases, year):
     try:
         clean_title = cleantitle.geturl(title)
         search_url = urlparse.urljoin(self.base_link, self.search_link)
         post = ('do=search&subaction=search&search_start=0&full_search=0&result_from=1&story=%s+%s' % (clean_title.replace('-','+'), year))
         r = client.request(search_url, post=post)
         r = dom_parser2.parse_dom(r, 'article', {'class': ['shortstory','cf']})[0]
         r = dom_parser2.parse_dom(r.content, 'a', req='href')[0]
         url = r.attrs['href']
         return url
     except Exception:
         return
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:12,代码来源:moviego.py


示例14: movie

 def movie(self, imdb, title, localtitle, aliases, year):
     try:
         clean_title = cleantitle.geturl(title)
         search_url = urlparse.urljoin(self.base_link, self.search_link_movie % clean_title.replace('-','+'))
         r = cache.get(client.request, 6, search_url)
         r = dom_parser2.parse_dom(r, 'div', {'class': 'movie'})
         r = [(dom_parser2.parse_dom(i.content, 'a', req='href'), \
               dom_parser2.parse_dom(i.content, 'div', {'class': 'year'})) \
               for i in r]
         r = [(urlparse.urljoin(self.base_link, i[0][0].attrs['href']), i[1][0].content) for i in r if i[1][0].content == year]
         url = r[0][0]
         return url
     except Exception:
         return
开发者ID:CYBERxNUKE,项目名称:xbmc-addon,代码行数:14,代码来源:icefilmsis.py


示例15: movie

 def movie(self, imdb, title, localtitle, aliases, year):
     try:
         clean_title = cleantitle.geturl(title)
         search_url = urlparse.urljoin(self.base_link, self.search_link % clean_title.replace('-', '+'))
         r = self.scraper.get(search_url).content
         r = dom_parser2.parse_dom(r, 'li', {'class': 'item'})
         r = [(dom_parser2.parse_dom(i, 'a', attrs={'class': 'title'}),
               re.findall('status-year">(\d{4})</div', i.content, re.DOTALL)[0]) for i in r if i]
         r = [(i[0][0].attrs['href'], re.findall('(.+?)</b><br', i[0][0].content, re.DOTALL)[0], i[1]) for i in r if i]
         r = [(i[0], i[1], i[2]) for i in r if (cleantitle.get(i[1]) == cleantitle.get(title) and i[2] == year)]
         url = r[0][0]
         return url
     except Exception:
         return
开发者ID:vphuc81,项目名称:MyRepository,代码行数:14,代码来源:kattv.py


示例16: sources

 def sources(self, url, hostDict, hostprDict):
     try:
         sources = []          
         r = cache.get(client.request, 6, url)
         try:
             v = re.findall('\$\.get\(\'(.+?)(?:\'\,\s*\{\"embed\":\")([\d]+)', r)
             for i in v:
                 url = urlparse.urljoin(self.base_link, i[0] + '?embed=%s' % i[1])
                 ri = cache.get(client.request, 6, search_url)
                 url = dom_parser2.parse_dom(ri, 'iframe', req='src')[0]
                 url = url.attrs['src']
                 try:
                     host = re.findall('([\w]+[.][\w]+)$', urlparse.urlparse(url.strip().lower()).netloc)[0]
                     if host in hostDict:
                         host = client.replaceHTMLCodes(host)
                         host = host.encode('utf-8')
                         sources.append({
                             'source': host,
                             'quality': 'SD',
                             'language': 'en',
                             'url': url.replace('\/','/'),
                             'direct': False,
                             'debridonly': False
                         })
                 except: pass
         except: pass
         r = dom_parser2.parse_dom(r, 'div', {'class': ['btn','btn-primary']})
         r = [dom_parser2.parse_dom(i.content, 'a', req='href') for i in r]
         r = [(i[0].attrs['href'], re.search('<\/i>\s*(\w+)', i[0].content)) for i in r]
         r = [(i[0], i[1].groups()[0]) for i in r if i[1]]
         if r:
             for i in r:
                 try:
                     host = i[1]
                     url = i[0]
                     host = client.replaceHTMLCodes(host)
                     host = host.encode('utf-8')
                     sources.append({
                         'source': host,
                         'quality': 'SD',
                         'language': 'en',
                         'url': url.replace('\/','/'),
                         'direct': False,
                         'debridonly': False
                     })
                 except: pass
         return sources
     except Exception:
         return
开发者ID:CYBERxNUKE,项目名称:xbmc-addon,代码行数:49,代码来源:icefilmsis.py


示例17: episode

 def episode(self, url, imdb, tvdb, title, premiered, season, episode):
     try:
         if url == None: return
         r = client.request(url)
         r = dom_parser2.parse_dom(r, 'div', {'class': 'el-item'})
         r = [(dom_parser2.parse_dom(i, 'div', {'class': 'season'}), \
               dom_parser2.parse_dom(i, 'div', {'class': 'episode'}), \
               dom_parser2.parse_dom(i, 'a', req='href')) \
               for i in r if i]
         r = [(i[2][0].attrs['href']) for i in r if i[0][0].content == 'Season %01d' % int(season) \
               and i[1][0].content == 'Episode %01d' % int(episode)]
         if r: return r[0]
         else: return
     except:
         return
开发者ID:vphuc81,项目名称:MyRepository,代码行数:15,代码来源:weseries.py


示例18: sources

    def sources(self, url, hostDict, hostprDict):
        try:
            self._sources = []
            if url is None: return self._sources

            if debrid.status() is False: raise Exception()

            data = urlparse.parse_qs(url)
            data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data])

            title = data['tvshowtitle'] if 'tvshowtitle' in data else data['title']
            hdlr = 'S%02dE%02d' % (int(data['season']), int(data['episode'])) if 'tvshowtitle' in data else data['year']

            query = '%s S%02dE%02d' % (
            data['tvshowtitle'], int(data['season']), int(data['episode'])) if 'tvshowtitle' in data else '%s %s' % (
            data['title'], data['year'])
            query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query)

            query = cleantitle.geturl(query)
            url = urlparse.urljoin(self.base_link, query)

            headers = {'User-Agent': client.agent()}
            r = client.request(url, headers=headers)
            posts = dom_parser2.parse_dom(r, 'li', {'class': re.compile('.+?'), 'id': re.compile('comment-.+?')})
            self.hostDict = hostDict + hostprDict
            threads = []

            for i in posts: threads.append(workers.Thread(self._get_sources, i.content))
            [i.start() for i in threads]
            [i.join() for i in threads]

            return self._sources
        except Exception:
            return self._sources
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:34,代码来源:scnsrc.py


示例19: tvshow

    def tvshow(self, imdb, tvdb, tvshowtitle, localtvshowtitle, aliases, year):
        try:
            clean_title = cleantitle.geturl(tvshowtitle)
            search_url = urlparse.urljoin(self.base_link, self.search_link % clean_title.replace('-', '+'))
            r = client.request(search_url)
            r = client.parseDOM(r, 'div', {'class': 'result-item'})
            r = [(dom_parser2.parse_dom(i, 'a', req='href')[0],
                  client.parseDOM(i, 'img', ret='alt')[0],
                  dom_parser2.parse_dom(i, 'span', attrs={'class': 'year'})) for i in r]
            r = [(i[0].attrs['href'], i[1], i[2][0].content) for i in r if
                 (cleantitle.get(i[1]) == cleantitle.get(tvshowtitle) and i[2][0].content == year)]
            url = source_utils.strip_domain(r[0][0])

            return url
        except:
            return
开发者ID:varunrai,项目名称:repository.magicality,代码行数:16,代码来源:movie4uch.py


示例20: _get_items

    def _get_items(self, url):
        try:
            headers = {'User-Agent': client.agent()}
            r = client.request(url, headers=headers)
            posts = client.parseDOM(r, 'table', attrs={'class': 'table2'})[0]
            posts = client.parseDOM(posts, 'tr')
            for post in posts:
                data = dom.parse_dom(post, 'a', req='href')[1]
                link = urlparse.urljoin(self.base_link, data.attrs['href'])
                name = data.content
                t = name.split(self.hdlr)[0]

                if not cleantitle.get(re.sub('(|)', '', t)) == cleantitle.get(self.title): continue

                try:
                    y = re.findall('[\.|\(|\[|\s|\_|\-](S\d+E\d+|S\d+)[\.|\)|\]|\s|\_|\-]', name, re.I)[-1].upper()
                except BaseException:
                    y = re.findall('[\.|\(|\[|\s\_|\-](\d{4})[\.|\)|\]|\s\_|\-]', name, re.I)[-1].upper()
                if not y == self.hdlr: continue

                try:
                    size = re.findall('((?:\d+\,\d+\.\d+|\d+\.\d+|\d+\,\d+|\d+)\s*(?:GiB|MiB|GB|MB))', post)[0]
                    div = 1 if size.endswith('GB') else 1024
                    size = float(re.sub('[^0-9|/.|/,]', '', size.replace(',', '.'))) / div
                    size = '%.2f GB' % size
                except BaseException:
                    size = '0'

                self.items.append((name, link, size))
            return self.items
        except BaseException:
            return self.items
开发者ID:YourFriendCaspian,项目名称:dotfiles,代码行数:32,代码来源:limetorrents.py



注:本文中的resources.lib.modules.dom_parser2.parse_dom函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python jsunpack.unpack函数代码示例发布时间:2022-05-26
下一篇:
Python dom_parser.parse_dom函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap