本文整理汇总了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
示例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)
示例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
示例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
示例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)
示例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)
示例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)
示例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)
示例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
示例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)
示例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)
示例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)
示例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)
示例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)
示例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%. +-]+)*')