当前位置: 首页>>代码示例>>Python>>正文


Python compat.urljoin函数代码示例

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


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

示例1: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, 'HDSpace')

        # Credentials
        self.username = None
        self.password = None

        # URLs
        self.url = 'https://hd-space.org'
        self.urls = {
            'login': urljoin(self.url, 'index.php?page=login'),
            'search': urljoin(self.url, 'index.php'),
        }

        # Proper Strings

        # Miscellaneous Options

        # Torrent Stats
        self.minseed = None
        self.minleech = None

        # Cache
        self.cache = tvcache.TVCache(self, min_time=10)  # only poll HDSpace every 10 minutes max
开发者ID:Eiber,项目名称:SickRage-Medusa,代码行数:26,代码来源:hdspace.py

示例2: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, "TransmitTheNet")

        # Credentials
        self.username = None
        self.password = None

        # Torrent Stats
        self.minseed = None
        self.minleech = None
        self.freeleech = None

        # URLs
        self.url = 'https://transmithe.net/'
        self.urls = {
            'login': urljoin(self.url, '/login.php'),
            'search': urljoin(self.url, '/torrents.php'),
        }

        # Proper Strings

        # Cache
        self.cache = tvcache.TVCache(self)
开发者ID:bitzorro,项目名称:SickRage,代码行数:25,代码来源:transmitthenet.py

示例3: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, 'TorrentDay')

        # Credentials
        self.username = None
        self.password = None

        # URLs
        self.url = 'https://classic.torrentday.com'
        self.urls = {
            'login': urljoin(self.url, '/torrents/'),
            'search': urljoin(self.url, '/V3/API/API.php'),
            'download': urljoin(self.url, '/download.php/')
        }

        # Proper Strings

        # Miscellaneous Options
        self.freeleech = False
        self.enable_cookies = True
        self.cookies = ''

        self.categories = {'Season': {'c14': 1}, 'Episode': {'c2': 1, 'c26': 1, 'c7': 1, 'c24': 1},
                           'RSS': {'c2': 1, 'c26': 1, 'c7': 1, 'c24': 1, 'c14': 1}}

        # Torrent Stats
        self.minseed = None
        self.minleech = None

        # Cache
        self.cache = tvcache.TVCache(self, min_time=10)  # Only poll IPTorrents every 10 minutes max
开发者ID:Eiber,项目名称:SickRage-Medusa,代码行数:33,代码来源:torrentday.py

示例4: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, "ThePirateBay")

        # Credentials
        self.public = True

        # Torrent Stats
        self.minseed = None
        self.minleech = None
        self.confirmed = True

        # URLs
        self.url = "https://thepiratebay.se"
        self.urls = {
            "rss": urljoin(self.url, "browse/200"),
            "search": urljoin(self.url, "s/"),  # Needs trailing /
        }
        self.custom_url = None

        # Proper Strings

        # Cache
        self.cache = tvcache.TVCache(self, min_time=30)  # only poll ThePirateBay every 30 minutes max
开发者ID:Comptezero,项目名称:SickRage,代码行数:25,代码来源:thepiratebay.py

示例5: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, 'MoreThanTV')

        # Credentials
        self.username = None
        self.password = None
        self._uid = None
        self._hash = None

        # URLs
        self.url = 'https://www.morethan.tv/'
        self.urls = {
            'login': urljoin(self.url, 'login.php'),
            'search': urljoin(self.url, 'torrents.php'),
        }

        # Proper Strings
        self.proper_strings = ['PROPER', 'REPACK']

        # Miscellaneous Options

        # Torrent Stats
        self.minseed = None
        self.minleech = None

        # Cache
        self.cache = tvcache.TVCache(self)
开发者ID:Eiber,项目名称:SickRage-Medusa,代码行数:29,代码来源:morethantv.py

示例6: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, 'HoundDawgs')

        # Credentials
        self.username = None
        self.password = None

        # URLs
        self.url = 'https://hounddawgs.org'
        self.urls = {
            'base_url': self.url,
            'search': urljoin(self.url, 'torrents.php'),
            'login': urljoin(self.url, 'login.php'),
        }

        # Proper Strings

        # Miscellaneous Options
        self.freeleech = None
        self.ranked = None

        # Torrent Stats
        self.minseed = None
        self.minleech = None

        # Cache
        self.cache = tvcache.TVCache(self)
开发者ID:Eiber,项目名称:SickRage-Medusa,代码行数:29,代码来源:hounddawgs.py

示例7: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, "Speedcd")

        # Credentials
        self.username = None
        self.password = None

        # Torrent Stats
        self.minseed = None
        self.minleech = None
        self.freeleech = False

        # URLs
        self.url = 'https://speed.cd'
        self.urls = {
            'login': urljoin(self.url, 'take.login.php'),
            'search': urljoin(self.url, 'browse.php'),
        }

        # Proper Strings
        self.proper_strings = ['PROPER', 'REPACK']

        # Cache
        self.cache = tvcache.TVCache(self)
开发者ID:ratoaq2,项目名称:SickRage,代码行数:26,代码来源:speedcd.py

示例8: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, "FileList")

        # Credentials
        self.username = None
        self.password = None

        # Torrent Stats
        self.minseed = None
        self.minleech = None

        # URLs
        self.url = "http://filelist.ro"
        self.urls = {
            "login": urljoin(self.url, "takelogin.php"),
            "search": urljoin(self.url, "browse.php"),
        }

        # Proper Strings
        self.proper_strings = ["PROPER", "REPACK"]

        # Cache
        self.cache = tvcache.TVCache(self)
开发者ID:ArthurGarnier,项目名称:SickRage,代码行数:25,代码来源:filelist.py

示例9: crawler

    def crawler(self):
        
        parser = argparse.ArgumentParser()
        parser.add_argument("keyword", help="keyword that you want to look for")
        parser.add_argument("-n", "--number", help="number of search result. default is 5", type=int, default=5)
        parser.add_argument("-p", "--page", help="page that you parse", type=int, default=1)
        args = parser.parse_args()

        url_req = urljoin(self.yt_url, "results?search_query={}&page={}".format(args.keyword, args.page))   
        page = requests.get(url_req)
        
        collection = []
        counter = args.number
        
        tree = html.fromstring(page.text)
        for subtree in tree.xpath('//div[@class="yt-lockup-content"]'):
            if counter > 0:
                item = {}
                item['title'] = subtree.xpath('./h3[@class="yt-lockup-title "]/a/text()')[0]
                item['link'] = urljoin(self.yt_url, subtree.xpath('./h3[@class="yt-lockup-title "]/a/@href')[0])
                item['desc'] = "" if len(subtree.xpath('./div/text()')) == 0 else subtree.xpath('./div/text()')[0] 

                detail = self.__getdetail(item['link'])
                item.update(detail)
                short_url = self.__getshorturl(item['link'])
                item.update(short_url)

                collection.append(YTSearchResult(**item))
                
                counter -= 1
            else:
                break;

        return collection 
开发者ID:yltsou,项目名称:youtube-CLI,代码行数:34,代码来源:youtube.py

示例10: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, "PhxBit")

        # Credentials
        self.username = None
        self.password = None

        # Torrent Stats
        self.minseed = None
        self.minleech = None

        # URLs
        self.url = 'https://phxbit.com'
        self.urls = {
            'login': urljoin(self.url, '/connect.php'),
            'search': urljoin(self.url, '/sphinx.php')
        }

        # Proper Strings
        self.proper_strings = ['PROPER']

        # Cache
        self.cache = tvcache.TVCache(self, min_time=30)
开发者ID:DazzFX,项目名称:SickRage,代码行数:25,代码来源:phxbit.py

示例11: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, "Immortalseed")

        # Credentials
        self.username = None
        self.password = None
        self.passkey = None

        # Torrent Stats
        self.minseed = None
        self.minleech = None
        self.freeleech = None

        # URLs
        self.url = 'https://immortalseed.me/'
        self.urls = {
            'login': urljoin(self.url, 'takelogin.php'),
            'search': urljoin(self.url, 'browse.php'),
            'rss': urljoin(self.url, 'rss.php'),
        }

        # Proper Strings
        self.proper_strings = ['PROPER', 'REPACK']

        # Cache
        self.cache = ImmortalseedCache(self, min_time=20)
开发者ID:murbaniak,项目名称:SickRage,代码行数:28,代码来源:immortalseed.py

示例12: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, "ABNormal")

        # Credentials
        self.username = None
        self.password = None

        # Torrent Stats
        self.ratio = None
        self.minseed = None
        self.minleech = None

        # URLs
        self.url = "https://abnormal.ws"
        self.urls = {
            "login": urljoin(self.url, "login.php"),
            "search": urljoin(self.url, "torrents.php"),
        }

        # Proper Strings
        self.proper_strings = ["PROPER"]

        # Cache
        self.cache = tvcache.TVCache(self, min_time=30)
开发者ID:piejanssens,项目名称:SickRage-1,代码行数:26,代码来源:abnormal.py

示例13: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, 'TorrentLeech')

        # Credentials
        self.username = None
        self.password = None

        # URLs
        self.url = 'https://torrentleech.org'
        self.urls = {
            'login': urljoin(self.url, 'user/account/login/'),
            'search': urljoin(self.url, 'torrents/browse'),
        }

        # Proper Strings
        self.proper_strings = ['PROPER', 'REPACK']

        # Miscellaneous Options

        # Torrent Stats
        self.minseed = None
        self.minleech = None

        # Cache
        self.cache = tvcache.TVCache(self)
开发者ID:Eiber,项目名称:SickRage-Medusa,代码行数:27,代码来源:torrentleech.py

示例14: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, 'TorrentBytes')

        # Credentials
        self.username = None
        self.password = None

        # URLs
        self.url = 'https://www.torrentbytes.net'
        self.urls = {
            'login': urljoin(self.url, 'takelogin.php'),
            'search': urljoin(self.url, 'browse.php')
        }

        # Proper Strings
        self.proper_strings = ['PROPER', 'REPACK']

        # Miscellaneous Options
        self.freeleech = False

        # Torrent Stats
        self.minseed = None
        self.minleech = None

        # Cache
        self.cache = tvcache.TVCache(self)
开发者ID:Eiber,项目名称:SickRage-Medusa,代码行数:28,代码来源:torrentbytes.py

示例15: __init__

    def __init__(self):

        # Provider Init
        TorrentProvider.__init__(self, "ThePirateBay")

        # Credentials
        self.public = True

        # Torrent Stats
        self.minseed = None
        self.minleech = None
        self.confirmed = True

        # URLs
        self.url = "https://thepiratebay.se"
        self.urls = {
            "rss": [urljoin(self.url, "browse/208/0/4/0"), urljoin(self.url, "browse/205/0/4/0")],
            "search": urljoin(self.url, "search"),
        }
        self.custom_url = None

        # Proper Strings

        # Cache
        self.cache = tvcache.TVCache(self, min_time=30)  # only poll ThePirateBay every 30 minutes max

        self.magnet_regex = re.compile(r'magnet:\?xt=urn:btih:\w{32,40}(:?&dn=[\w. %+-]+)*(:?&tr=(:?tcp|https?|udp)[\w%. +-]+)*')
开发者ID:Zelgadis87,项目名称:SickRage,代码行数:27,代码来源:thepiratebay.py


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