這是1337x的非官方API。它支援1337x的所有代理程式和1337x的幾乎所有功能。您可以搜尋、獲取趨勢、熱門和流行的種子。此外,您還可以瀏覽特定類別的種子。它還支援按類別過濾結果,支援排序和快取。
透過 PyPi 安裝
pip install 1337x
從來源安裝
git clone https://github.com/hemantapkh/1337x && cd 1337x && python setup.py sdist && pip install dist/ *
>> > from py1337x import py1337x
# Using 1337x.tw and saving the cache in sqlite database which expires after 500 seconds
>> > torrents = py1337x ( proxy = '1337x.to' , cache = 'py1337xCache' , cacheTime = 500 )
>> > torrents . search ( 'harry potter' )
{ 'items' : [...], 'currentPage' : 1 , 'itemCount' : 20 , 'pageCount' : 50 }
# Searching harry potter in category movies and sort by seeders in descending order
>> > torrents . search ( 'harry potter' , category = 'movies' , sortBy = 'seeders' , order = 'desc' )
{ 'items' : [...], 'currentPage' : 1 , 'itemCount' : 40 , 'pageCount' : 50 }
# Viewing the 5th page of the result
>> > torrents . search ( 'harry potter' , page = 5 )
{ 'items' : [...], 'currentPage' : , 'itemCount' : 20 , 'pageCount' : 50 }
>> > from py1337x import py1337x
# Using the default proxy (1337x.to) Without using cache
>> > torrents = py1337x ()
# Today's trending torrents of all category
>> > torrents . trending ()
{ 'items' : [...], 'currentPage' : 1 , 'itemCount' : 50 , 'pageCount' : 1 }
# Trending torrents this week of all category
>> > torrents . trending ( week = True )
{ 'items' : [...], 'currentPage' : 1 , 'itemCount' : 50 , 'pageCount' : 1 }
# Todays trending anime
>> > torrents . trending ( category = 'anime' )
{ 'items' : [...], 'currentPage' : 1 , 'itemCount' : 50 , 'pageCount' : 1 }
# Trending anime this week
>> > torrents . trending ( category = 'anime' , week = True )
{ 'items' : [...], 'currentPage' : 1 , 'itemCount' : 50 , 'pageCount' : 1 }
>> > from py1337x import py1337x
# Using 11337x.st and passing the cookie since 11337x.st is cloudflare protected
>> > torrents = py1337x ( '11337x.st' , cookie = '<cookie>' )
# Getting the information of a torrent by its link
>> > torrents . info ( link = 'https://www.1337xx.to/torrent/258188/h9/' )
{ 'name' : 'Harry Potter and the Half-Blood Prince' , 'shortName' : 'Harry Potter' , 'description' : "...." , 'category' : 'Movies' , 'type' : 'HD' , 'genre' : [ 'Adventure' , 'Fantasy' , 'Family' ], 'language' : 'English' , 'size' : '3.0 GB' , 'thumbnail' : '...' , 'images' : [...], 'uploader' : ' ...' , 'uploaderLink' : '...' , 'downloads' : '5310' , 'lastChecked' : '44 seconds ago' , 'uploadDate' : '4 years ago' , 'seeders' : '36' , 'leechers' : '3' , 'magnetLink' : '...' , 'infoHash' : '...' }
# Getting the information of a torrent by its link
>> > torrents . info ( torrentId = '258188' )
{ 'name' : 'Harry Potter and the Half-Blood Prince' , 'shortName' : 'Harry Potter' , 'description' : "...." , 'category' : 'Movies' , 'type' : 'HD' , 'genre' : [ 'Adventure' , 'Fantasy' , 'Family' ], 'language' : 'English' , 'size' : '3.0 GB' , 'thumbnail' : '...' , 'images' : [...], 'uploader' : ' ...' , 'uploaderLink' : '...' , 'downloads' : '5310' , 'lastChecked' : '44 seconds ago' , 'uploadDate' : '4 years ago' , 'seeders' : '36' , 'leechers' : '3' , 'magnetLink' : '...' , 'infoHash' : '...' }
from py1337x import py1337x
torrents = py1337x ( proxy = '1337x.st' , cookie = '<cookie>' , cache = 'py1337xCache' , cacheTime = 86400 , backend = 'sqlite' )
代理人
如果預設網域在您的國家/地區被禁止,您可以使用替代網域 1337x。
1337x.to
(預設)1337x.st
x1337x.ws
x1337x.eu
x1337x.se
1337x.so
1377x.to
(非官方)1337xx.to
(非官方)餅乾
一些代理受 Cloudflare 保護。對於此類代理,您需要傳遞 cookie 值。若要取得 cookie,請從瀏覽器造訪受保護的站點,解析驗證碼並複製cf_clearance
的值。
Firefox: Inspect element > Storage > Cookies
Chrome: Inspect element > Application > Storage > Cookies
快取
Py1337x 使用 requests-cache 進行快取來儲存數據,以便可以更快地滿足未來對該數據的請求。 cache
可以是以下任何一個。
True
表示使用緩存, False
表示不使用快取。 (預設不使用快取)快取時間
預設情況下,快取會在一天後過期。您可以透過設定自訂cacheTime
來更改快取過期時間。
-1
(永不過期)
0
(“立即過期”,例如繞過快取)
正數(以秒為單位[預設為 86400 ])
timedelta
datetime
後端
用於儲存快取的後端可以是以下任一種。
'sqlite'
:SQLite 資料庫(預設)
'redis'
:Redis 快取( requires redis
)
'mongodb'
:MongoDB 資料庫( requires pymongo
)
'gridfs'
:MongoDB 資料庫上的 GridFS 集合( requires pymongo
)
'dynamodb'
:Amazon DynamoDB 資料庫( requires boto3
)
'memory'
:非持久性緩存,僅將回應儲存在記憶體中
from py1337x import py1337x
torrents = py1337x ()
方法 | 描述 | 論點 |
---|---|---|
種子搜尋(查詢) | 搜尋種子 | 自己, 查詢: Keyword to search for ,page(預設為1): Page to view ,類別(可選):類別, sortBy(可選):排序依據, 訂單(可選):訂單 |
種子.trending() | 取得熱門種子 | 自己, 類別(可選):類別, week(預設為 False): True for weekely, False for daily |
種子.top() | 取得熱門種子 | 自己, 類別(可選):類別 |
種子.流行(類) | 取得熱門種子 | 自己, 類別: 類別, week(預設為 False): True for weekely, False for daily |
種子.瀏覽(分類) | 瀏覽特定類別的瀏覽 | 自己, 類別: 類別, page(預設為1): Page to view |
torrent.info(連結或 torrentId) | 獲取 torrent 的信息 | 自己, 連結: Link of a torrent 或torrentId: ID of a torrent |
'movies'
'tv'
'games'
'music'
'apps'
'anime'
'documentaries'
'xxx'
'others'
'time'
'size'
'seeders'
'leechers'
'desc'
(降序排列)'asc'
(升序) 我們非常感謝您所做的任何貢獻。
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)感謝為本計畫做出貢獻的每一位貢獻者。
想在這裡列出您的項目嗎?只需提出拉取請求即可。
根據 MIT 許可證分發。請參閱許可證以了解更多資訊。
作者/維護者:Hemanta Pokharel | Youtube:@H9Youtube