可以使用Folx 5來(lái)快速制作種子文件及磁力鏈接。

站在用戶的角度思考問題,與客戶深入溝通,找到孟村網(wǎng)站設(shè)計(jì)與孟村網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:成都網(wǎng)站制作、成都網(wǎng)站設(shè)計(jì)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名注冊(cè)、雅安服務(wù)器托管、企業(yè)郵箱。業(yè)務(wù)覆蓋孟村地區(qū)。
一、制作種子文件
第一步,打開Folx軟件,在上方的菜單中,選擇“文件”菜單,然后點(diǎn)擊其中的“創(chuàng)建種子文件”。
第二步,在打開的創(chuàng)建種子文件界面上,點(diǎn)擊右側(cè)的三個(gè)點(diǎn)按鈕,選擇位于Mac上的應(yīng)用或者文件,然后點(diǎn)擊“好”,即可為該應(yīng)用或文件制作對(duì)應(yīng)的種子文件。
從界面紅框可知,大家可以自定義創(chuàng)建的種子的文件名、文件保存路徑、文件塊大小和文件的選項(xiàng)設(shè)置。
在文件名輸入框中輸入文件名,即可為種子定義一個(gè)種子文件名,否則種子文件名將默認(rèn)按照文件的名稱來(lái)命名;
然后在“保存至”選項(xiàng)中,設(shè)置種子的保存路徑,免得制作完成以后找不到種子文件;
然后就是塊大小,這里采用默認(rèn)設(shè)置即可;
最后還有一個(gè)選項(xiàng)設(shè)置,可以設(shè)置是否立即開始制作種子以及種子是否是私人可用的。
制作完成以后,種子文件如下圖所示,文件格式為“torrent”。
二、獲取磁力鏈接
首先在Folx右側(cè)的標(biāo)簽欄中,點(diǎn)擊“我的上傳”標(biāo)簽,從中找到剛剛制作的種子文件,然后鼠標(biāo)右鍵點(diǎn)擊該種子文件,在打開的菜單中,選擇“復(fù)制磁力鏈接”,如下圖所示,即可得到該種子的磁力鏈接了。
1、首先在應(yīng)用商店下載迅雷APP。
2、然后在迅雷APP中完成登錄注冊(cè),在右上方找到磁力鏈接收文本框。
3、將磁力鏈的復(fù)制代碼轉(zhuǎn)移到文本框中,迅雷就會(huì)自動(dòng)讀取并下載磁力鏈中的視頻。
這個(gè)是迅雷磁力鏈接,在迅雷代碼里面使用,都是此代碼是錯(cuò)的,無(wú)法使用。
迅雷磁力是迅雷5的一個(gè)新功能,允許用戶使用磁力鏈接下載,基于文件的位置或名稱,磁鏈接與傳統(tǒng)連接不同,它們只是生成不同文件內(nèi)容的散列結(jié)果的純文本數(shù)字指紋,并使用它來(lái)標(biāo)識(shí)文件。
這意味著磁鏈不需要中心機(jī)構(gòu)的支持,識(shí)別精度極高。
擴(kuò)展資料:
注意事項(xiàng):
迅雷磁力鏈接由一組參數(shù)組成,參數(shù)之間的順序并不特別,其格式與HTTP鏈接末尾的查詢字符串相同。URN通常由特定文件內(nèi)容的哈希函數(shù)值組成,盡管這個(gè)鏈接指向一個(gè)特定的文件,但Thunderbolt客戶機(jī)應(yīng)用程序仍然必須搜索以確定位置。
但是Thunderbolt的磁性鏈接的優(yōu)勢(shì)在于它是開放的和跨平臺(tái)的,因?yàn)槿魏稳硕伎梢苑职l(fā)磁性鏈接來(lái)確保資源是他們想要的,而不管他們是如何得到的。
磁力鏈接都是以magnet:?xt=urn:btih:開頭的字符串
所以可以通過判斷字符串中是否有magnet:?xt=urn:btih:來(lái)初步簡(jiǎn)單的判斷是否包含磁力鏈接
public?class?Demo?{
public?static?void?main(String[]?args)?{
String?str?=?"發(fā)酵飼料的飛機(jī)magnet:?xt=urn:btih:0E9CD4D2A90EA2F2F4D42F1C35CC7BF8E1CBBB8A阿薩德飛說(shuō)";
if?(str.contains("magnet:?xt=urn:btih:"))?{
System.out.println("有磁力鏈接");
}?else?{
System.out.println("沒有磁力鏈接");
}
}
相應(yīng)的將BT種子轉(zhuǎn)換為磁力鏈代碼為:
import bencode, hashlib, base64, urllib
torrent = open('ubuntu-12.04.2-server-amd64.iso.torrent', 'rb').read()
metadata = bencode.bdecode(torrent)
hashcontents = bencode.bencode(metadata['info'])
digest = hashlib.sha1(hashcontents).digest()
b32hash = base64.b32encode(digest)
params = {'xt': 'urn:btih:%s' % b32hash,
'dn': metadata['info']['name'],
'tr': metadata['announce'],
'xl': metadata['info']['length']}
paramstr = urllib.urlencode(params)
magneturi = 'magnet:?%s' % paramstr
print magneturi
還有另外一個(gè)效率相對(duì)較高,而且更方便的方案是安裝libtorrent,在ubuntu只需要apt-get install python-libtorrent即可對(duì)應(yīng)轉(zhuǎn)換磁力鏈的代碼為:
import libtorrent as bt
info = bt.torrent_info('test.torrent')
print "magnet:?xt=urn:btih:%sdn=%s" % (info.info_hash(), info.name())
轉(zhuǎn)換磁力鏈接為bt種子文件
下面來(lái)看一個(gè)反過程,將磁力鏈轉(zhuǎn)化為種子文件。
1、需要先安裝python-libtorrent包 ,在ubuntu環(huán)境下,可以通過以下指令完成安裝:
# sudo apt-get install python-libtorrent
2、代碼如下:
#!/usr/bin/env python
import shutil
import tempfile
import os.path as pt
import sys
import libtorrent as lt
from time import sleep
def magnet2torrent(magnet, output_name=None):
if output_name and \
not pt.isdir(output_name) and \
not pt.isdir(pt.dirname(pt.abspath(output_name))):
print("Invalid output folder: " + pt.dirname(pt.abspath(output_name)))
print("")
sys.exit(0)
tempdir = tempfile.mkdtemp()
ses = lt.session()
params = {
'save_path': tempdir,
'duplicate_is_error': True,
'storage_mode': lt.storage_mode_t(2),
'paused': False,
'auto_managed': True,
'duplicate_is_error': True
}
handle = lt.add_magnet_uri(ses, magnet, params)
print("Downloading Metadata (this may take a while)")
while (not handle.has_metadata()):
try:
sleep(1)
except KeyboardInterrupt:
print("Aborting...")
ses.pause()
print("Cleanup dir " + tempdir)
shutil.rmtree(tempdir)
sys.exit(0)
ses.pause()
print("Done")
torinfo = handle.get_torrent_info()
torfile = lt.create_torrent(torinfo)
output = pt.abspath(torinfo.name() + ".torrent")
if output_name:
if pt.isdir(output_name):
output = pt.abspath(pt.join(
output_name, torinfo.name() + ".torrent"))
elif pt.isdir(pt.dirname(pt.abspath(output_name))):
output = pt.abspath(output_name)
print("Saving torrent file here : " + output + " ...")
torcontent = lt.bencode(torfile.generate())
f = open(output, "wb")
f.write(lt.bencode(torfile.generate()))
f.close()
print("Saved! Cleaning up dir: " + tempdir)
ses.remove_torrent(handle)
shutil.rmtree(tempdir)
return output
def showHelp():
print("")
print("USAGE: " + pt.basename(sys.argv[0]) + " MAGNET [OUTPUT]")
print(" MAGNET\t- the magnet url")
print(" OUTPUT\t- the output torrent file name")
print("")
def main():
if len(sys.argv) 2:
showHelp()
sys.exit(0)
magnet = sys.argv[1]
output_name = None
if len(sys.argv) = 3:
output_name = sys.argv[2]
magnet2torrent(magnet, output_name)
if __name__ == "__main__":
main()
3、用法如下
# python Magnet_To_Torrent2.py magnet link [torrent file]
分享題目:java磁力鏈接實(shí)現(xiàn)代碼 磁力源代碼
網(wǎng)頁(yè)網(wǎng)址:http://chinadenli.net/article0/hppsoo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、電子商務(wù)、定制網(wǎng)站、商城網(wǎng)站、網(wǎng)站內(nèi)鏈、網(wǎng)站維護(hù)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)