參與討論

2 則留言

  1. https://yts.lt/torrent/download/866BDCFA006930A718ADBC21D8CAE1F2C7F9D8B3
    2021-01-20 00:49:28.202376
    Downloading Metadata…
    Got Metadata, Starting Torrent Download…
    Starting Avengers Infinity War (2018) [BluRay] [1080p] [YTS.AM]
    0.00% complete (down: 0.0 kb/s up: 0.0 kB/s peers: 0) checking
    45.13% complete (down: 0.0 kb/s up: 0.0 kB/s peers: 0) checking
    0.02% complete (down: 0.0 kb/s up: 0.0 kB/s peers: 0) downloading
    0.02% complete (down: 28.8 kb/s up: 2.1 kB/s peers: 7) downloading
    0.33% complete (down: 1327.9 kb/s up: 45.5 kB/s peers: 14) downloading
    0.82% complete (down: 2334.4 kb/s up: 80.1 kB/s peers: 23) downloading
    1.29% complete (down: 2541.1 kb/s up: 87.2 kB/s peers: 30) downloading
    1.84% complete (down: 2801.2 kb/s up: 95.8 kB/s peers: 35) downloading
    2.38% complete (down: 2966.3 kb/s up: 100.0 kB/s peers: 40) downloading
    2.94% complete (down: 3059.9 kb/s up: 104.9 kB/s peers: 42) downloading
    3.56% complete (down: 3223.8 kb/s up: 110.3 kB/s peers: 50) downloading
    4.17% complete (down: 3059.2 kb/s up: 107.6 kB/s peers: 91) downloading
    4.76% complete (down: 3282.6 kb/s up: 114.5 kB/s peers: 121) downloading
    5.51% complete (down: 3758.4 kb/s up: 132.2 kB/s peers: 124) downloading
    6.27% complete (down: 3776.5 kb/s up: 128.2 kB/s peers: 101) downloading
    7.15% complete (down: 4281.3 kb/s up: 146.8 kB/s peers: 66) downloading
    7.98% complete (down: 4552.5 kb/s up: 154.6 kB/s peers: 69) downloading
    8.71% complete (down: 4134.4 kb/s up: 141.4 kB/s peers: 104) downloading
    9.42% complete (down: 4018.9 kb/s up: 138.8 kB/s peers: 121) downloading
    10.08% complete (down: 3731.1 kb/s up: 136.3 kB/s peers: 131) downloading
    10.74% complete (down: 3676.9 kb/s up: 140.9 kB/s peers: 121) downloading
    11.44% complete (down: 3850.5 kb/s up: 141.0 kB/s peers: 107) downloading
    12.26% complete (down: 4065.1 kb/s up: 147.4 kB/s peers: 114) downloading
    13.00% complete (down: 4017.4 kb/s up: 146.7 kB/s peers: 124) downloading
    13.69% complete (down: 3860.5 kb/s up: 141.8 kB/s peers: 130) downloading
    14.40% complete (down: 3701.4 kb/s up: 138.7 kB/s peers: 148) downloading
    15.18% complete (down: 3951.9 kb/s up: 145.1 kB/s peers: 137) downloading
    15.85% complete (down: 3842.9 kb/s up: 143.1 kB/s peers: 160) downloading
    16.57% complete (down: 3777.0 kb/s up: 138.4 kB/s peers: 178) downloading
    17.25% complete (down: 3800.3 kb/s up: 136.8 kB/s peers: 170) downloading
    17.96% complete (down: 3783.3 kb/s up: 136.2 kB/s peers: 160) downloading
    18.62% complete (down: 3575.5 kb/s up: 130.2 kB/s peers: 167) downloading
    19.40% complete (down: 3852.7 kb/s up: 138.9 kB/s peers: 161) downloading
    20.16% complete (down: 3872.5 kb/s up: 141.1 kB/s peers: 162) downloading
    20.96% complete (down: 4041.6 kb/s up: 146.3 kB/s peers: 163) downloading
    21.72% complete (down: 4165.1 kb/s up: 152.0 kB/s peers: 171) downloading
    22.53% complete (down: 4346.1 kb/s up: 156.2 kB/s peers: 163) downloading
    23.30% complete (down: 4307.0 kb/s up: 153.4 kB/s peers: 164) downloading
    24.08% complete (down: 4245.3 kb/s up: 153.0 kB/s peers: 159) downloading
    24.87% complete (down: 4202.2 kb/s up: 156.6 kB/s peers: 155) downloading
    25.68% complete (down: 4216.9 kb/s up: 157.8 kB/s peers: 169) downloading
    26.44% complete (down: 4288.4 kb/s up: 158.4 kB/s peers: 166) downloading
    27.23% complete (down: 4362.0 kb/s up: 160.5 kB/s peers: 147) downloading
    28.10% complete (down: 4495.2 kb/s up: 164.8 kB/s peers: 164) downloading
    28.92% complete (down: 4547.0 kb/s up: 163.4 kB/s peers: 170) downloading
    29.81% complete (down: 4620.9 kb/s up: 172.4 kB/s peers: 179) downloading
    30.63% complete (down: 4529.7 kb/s up: 167.7 kB/s peers: 182) downloading
    31.60% complete (down: 4684.4 kb/s up: 172.9 kB/s peers: 176) downloading
    32.52% complete (down: 4622.2 kb/s up: 171.6 kB/s peers: 177) downloading
    33.24% complete (down: 4389.9 kb/s up: 158.8 kB/s peers: 177) downloading
    33.93% complete (down: 3947.3 kb/s up: 143.6 kB/s peers: 177) downloading
    34.66% complete (down: 3717.3 kb/s up: 135.7 kB/s peers: 158) downloading
    35.39% complete (down: 3682.9 kb/s up: 135.2 kB/s peers: 167) downloading
    36.16% complete (down: 3696.5 kb/s up: 135.4 kB/s peers: 173) downloading
    36.71% complete (down: 3509.5 kb/s up: 126.1 kB/s peers: 162) downloading
    37.43% complete (down: 3447.0 kb/s up: 124.6 kB/s peers: 164) downloading
    38.01% complete (down: 3414.9 kb/s up: 123.4 kB/s peers: 165) downloading
    38.69% complete (down: 3432.3 kb/s up: 125.4 kB/s peers: 179) downloading
    39.36% complete (down: 3397.1 kb/s up: 125.6 kB/s peers: 171) downloading
    39.95% complete (down: 3319.8 kb/s up: 122.1 kB/s peers: 167) downloading
    40.64% complete (down: 3466.8 kb/s up: 126.9 kB/s peers: 184) downloading
    41.22% complete (down: 3439.5 kb/s up: 125.2 kB/s peers: 180) downloading
    41.83% complete (down: 3340.1 kb/s up: 121.7 kB/s peers: 182) downloading
    42.52% complete (down: 3427.1 kb/s up: 134.5 kB/s peers: 168) downloading
    43.13% complete (down: 3684.1 kb/s up: 146.0 kB/s peers: 179) downloading
    43.87% complete (down: 3739.1 kb/s up: 144.2 kB/s peers: 172) downloading
    44.56% complete (down: 3592.8 kb/s up: 136.4 kB/s peers: 164) downloading
    45.26% complete (down: 3769.4 kb/s up: 140.8 kB/s peers: 168) downloading
    46.00% complete (down: 3948.0 kb/s up: 145.3 kB/s peers: 186) downloading
    46.76% complete (down: 4134.9 kb/s up: 151.1 kB/s peers: 184) downloading
    47.61% complete (down: 4039.9 kb/s up: 145.9 kB/s peers: 174) downloading
    48.30% complete (down: 3972.2 kb/s up: 141.4 kB/s peers: 166) downloading
    49.03% complete (down: 3856.8 kb/s up: 139.9 kB/s peers: 183) downloading
    49.69% complete (down: 3590.6 kb/s up: 133.1 kB/s peers: 181) downloading
    50.31% complete (down: 3450.8 kb/s up: 132.9 kB/s peers: 177) downloading
    50.97% complete (down: 3546.7 kb/s up: 131.5 kB/s peers: 173) downloading
    51.63% complete (down: 3719.6 kb/s up: 137.2 kB/s peers: 185) downloading
    52.38% complete (down: 3731.5 kb/s up: 138.3 kB/s peers: 185) downloading
    52.97% complete (down: 3398.0 kb/s up: 132.1 kB/s peers: 167) downloading
    53.62% complete (down: 3393.3 kb/s up: 132.6 kB/s peers: 178) downloading
    54.29% complete (down: 3513.7 kb/s up: 130.2 kB/s peers: 185) downloading
    54.97% complete (down: 3669.1 kb/s up: 133.5 kB/s peers: 182) downloading
    55.61% complete (down: 3658.5 kb/s up: 134.6 kB/s peers: 176) downloading
    56.27% complete (down: 3694.0 kb/s up: 137.1 kB/s peers: 187) downloading
    56.92% complete (down: 3598.2 kb/s up: 133.3 kB/s peers: 194) downloading
    57.66% complete (down: 3728.8 kb/s up: 136.3 kB/s peers: 184) downloading
    58.35% complete (down: 3754.5 kb/s up: 140.2 kB/s peers: 189) downloading
    59.06% complete (down: 3927.8 kb/s up: 143.4 kB/s peers: 183) downloading
    59.91% complete (down: 4014.5 kb/s up: 150.7 kB/s peers: 177) downloading
    60.66% complete (down: 4066.3 kb/s up: 152.3 kB/s peers: 183) downloading
    61.54% complete (down: 4179.8 kb/s up: 154.8 kB/s peers: 174) downloading
    62.31% complete (down: 4172.5 kb/s up: 153.5 kB/s peers: 187) downloading
    63.03% complete (down: 4015.1 kb/s up: 145.8 kB/s peers: 188) downloading
    63.75% complete (down: 3846.2 kb/s up: 143.7 kB/s peers: 190) downloading
    64.45% complete (down: 3843.2 kb/s up: 143.0 kB/s peers: 181) downloading
    65.20% complete (down: 3983.3 kb/s up: 148.8 kB/s peers: 189) downloading
    65.89% complete (down: 4125.8 kb/s up: 153.6 kB/s peers: 185) downloading
    66.59% complete (down: 3660.8 kb/s up: 136.6 kB/s peers: 178) downloading
    67.24% complete (down: 3625.5 kb/s up: 137.3 kB/s peers: 189) downloading
    67.93% complete (down: 3738.3 kb/s up: 135.9 kB/s peers: 182) downloading
    68.65% complete (down: 3863.5 kb/s up: 142.3 kB/s peers: 185) downloading
    69.51% complete (down: 4326.2 kb/s up: 164.3 kB/s peers: 188) downloading
    70.12% complete (down: 3818.2 kb/s up: 143.6 kB/s peers: 182) downloading
    70.77% complete (down: 3811.9 kb/s up: 140.7 kB/s peers: 183) downloading
    71.41% complete (down: 3673.2 kb/s up: 136.8 kB/s peers: 189) downloading
    72.02% complete (down: 3663.2 kb/s up: 135.0 kB/s peers: 183) downloading
    72.70% complete (down: 3641.6 kb/s up: 132.0 kB/s peers: 187) downloading
    73.35% complete (down: 3298.3 kb/s up: 122.7 kB/s peers: 190) downloading
    74.04% complete (down: 3308.2 kb/s up: 124.6 kB/s peers: 186) downloading
    74.61% complete (down: 3303.2 kb/s up: 122.5 kB/s peers: 179) downloading
    75.20% complete (down: 3363.5 kb/s up: 121.9 kB/s peers: 172) downloading
    75.86% complete (down: 3402.0 kb/s up: 121.9 kB/s peers: 184) downloading
    76.55% complete (down: 3359.8 kb/s up: 121.8 kB/s peers: 184) downloading
    77.23% complete (down: 3278.3 kb/s up: 124.7 kB/s peers: 171) downloading
    77.81% complete (down: 3236.7 kb/s up: 122.2 kB/s peers: 186) downloading
    78.48% complete (down: 3177.4 kb/s up: 124.0 kB/s peers: 187) downloading
    78.95% complete (down: 2963.2 kb/s up: 117.7 kB/s peers: 183) downloading
    79.36% complete (down: 2803.8 kb/s up: 119.6 kB/s peers: 193) downloading
    79.89% complete (down: 2825.7 kb/s up: 119.5 kB/s peers: 176) downloading
    80.48% complete (down: 2936.8 kb/s up: 124.7 kB/s peers: 182) downloading
    80.98% complete (down: 2932.4 kb/s up: 121.8 kB/s peers: 188) downloading
    81.62% complete (down: 3008.2 kb/s up: 122.4 kB/s peers: 183) downloading
    82.21% complete (down: 2927.4 kb/s up: 125.1 kB/s peers: 180) downloading
    82.79% complete (down: 3062.2 kb/s up: 126.7 kB/s peers: 189) downloading
    83.41% complete (down: 3104.1 kb/s up: 130.2 kB/s peers: 187) downloading
    84.00% complete (down: 3177.0 kb/s up: 132.3 kB/s peers: 185) downloading
    84.61% complete (down: 3310.9 kb/s up: 135.6 kB/s peers: 190) downloading
    85.25% complete (down: 3267.1 kb/s up: 133.1 kB/s peers: 181) downloading
    85.86% complete (down: 3271.8 kb/s up: 134.6 kB/s peers: 189) downloading
    86.46% complete (down: 3363.2 kb/s up: 136.3 kB/s peers: 186) downloading
    87.13% complete (down: 3516.2 kb/s up: 140.0 kB/s peers: 178) downloading
    87.91% complete (down: 3691.9 kb/s up: 147.1 kB/s peers: 189) downloading
    88.61% complete (down: 3818.1 kb/s up: 148.3 kB/s peers: 189) downloading
    89.38% complete (down: 3891.6 kb/s up: 150.4 kB/s peers: 184) downloading
    90.10% complete (down: 3924.5 kb/s up: 152.7 kB/s peers: 185) downloading
    90.86% complete (down: 3837.5 kb/s up: 148.4 kB/s peers: 191) downloading
    91.52% complete (down: 3776.4 kb/s up: 143.5 kB/s peers: 191) downloading
    92.28% complete (down: 4024.2 kb/s up: 154.6 kB/s peers: 187) downloading
    92.97% complete (down: 3823.7 kb/s up: 146.2 kB/s peers: 187) downloading
    93.69% complete (down: 3978.2 kb/s up: 149.9 kB/s peers: 188) downloading
    94.40% complete (down: 3834.7 kb/s up: 146.1 kB/s peers: 182) downloading
    95.12% complete (down: 3764.1 kb/s up: 140.6 kB/s peers: 186) downloading
    95.82% complete (down: 3671.3 kb/s up: 134.9 kB/s peers: 186) downloading
    96.51% complete (down: 3719.1 kb/s up: 138.7 kB/s peers: 186) downloading
    97.25% complete (down: 3722.8 kb/s up: 140.9 kB/s peers: 188) downloading
    97.92% complete (down: 3626.8 kb/s up: 135.4 kB/s peers: 190) downloading
    98.60% complete (down: 3786.8 kb/s up: 142.4 kB/s peers: 182) downloading
    99.35% complete (down: 3745.8 kb/s up: 140.8 kB/s peers: 185) downloading
    Avengers Infinity War (2018) [BluRay] [1080p] [YTS.AM] COMPLETE
    Elapsed Time: 12 min : 22 sec
    2021-01-20 01:01:50.809204

  2. Code to download torrent
    Variable link stores the link string.

    import libtorrent as lt
    import time
    import datetime

    ses = lt.session()
    ses.listen_on(6881, 6891)
    params = {
    ‘save_path’: ‘/content/drive/My Drive/Torrent/’,
    ‘storage_mode’: lt.storage_mode_t(2),
    ‘paused’: False,
    ‘auto_managed’: True,
    ‘duplicate_is_error’: True}
    link = “https://yts.lt/torrent/download/866BDCFA006930A718ADBC21D8CAE1F2C7F9D8B3” # PASTE TORRENT/MAGNET LINK HERE
    print(link)

    handle = lt.add_magnet_uri(ses, link, params)
    ses.start_dht()

    begin = time.time()
    print(datetime.datetime.now())

    print (‘Downloading Metadata…’)
    while (not handle.has_metadata()):
    time.sleep(1)
    print (‘Got Metadata, Starting Torrent Download…’)

    print(“Starting”, handle.name())

    while (handle.status().state != lt.torrent_status.seeding):
    s = handle.status()
    state_str = [‘queued’, ‘checking’, ‘downloading metadata’, \
    ‘downloading’, ‘finished’, ‘seeding’, ‘allocating’]
    print (‘%.2f%% complete (down: %.1f kb/s up: %.1f kB/s peers: %d) %s ‘ % \
    (s.progress * 100, s.download_rate / 1000, s.upload_rate / 1000, \
    s.num_peers, state_str[s.state]))
    time.sleep(5)

    end = time.time()
    print(handle.name(), “COMPLETE”)

    print(“Elapsed Time: “,int((end-begin)//60),”min :”, int((end-begin)%60), “sec”)

    print(datetime.datetime.now())

    看不到能改的地方,比V1版差一點。

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *