├── LICENSE ├── README.md └── Google_Drive_Torrent_Downlaoder.ipynb /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Shubham Badgujar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/shubham8550/Google-Drive-Torrent-Downlaoder/blob/main/Google_Drive_Torrent_Downlaoder.ipynb) 3 | 4 | 5 | > Using This python .ipynb Script on Google Colab you can directly 6 | > Transfer/download Torrent in your Google Drive Account 7 | 8 | --- 9 | 10 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/shubham8550/Google-Drive-Torrent-Downlaoder/blob/main/Google_Drive_Torrent_Downlaoder.ipynb) 11 | 12 | **How To?** 13 | Open This Script in google colab change magnet link in 4th cell And Run Each Cell One By One As mentioned Below. 14 | 15 | 16 | 17 | **Step 1** : install libtorrent Package 18 | 19 | 20 | !apt-get install python3-libtorrent 21 | 22 | **Step 2** : Import libtorrent 23 | 24 | 25 | 26 | import libtorrent as lt 27 | 28 | **Step 3** : Mount your Google Drive 29 | 30 | 31 | from google.colab import drive 32 | 33 | drive.mount('/content/gdrive2') 34 | 35 | **Step 4** : Replace your Magnet Link And Run Cell ,And thats It. Have a Fun !! 36 | 37 | 38 | import libtorrent as lt 39 | import time 40 | 41 | ses = lt.session() 42 | params = { 'save_path': '/content/gdrive2/My Drive'} 43 | link = "magnet:?xt=urn:btih:d72af2a6f1b29537399db84a5093287d9a3fecee&dn=Unity-2020.1.16f1" 44 | handle = lt.add_magnet_uri(ses, link, params) 45 | 46 | print('downloading metadata...') 47 | while (not handle.has_metadata()): time.sleep(1) 48 | print('got metadata, starting torrent download...') 49 | while (handle.status().state != lt.torrent_status.seeding): 50 | print('%d %% done' % (handle.status().progress*100)) 51 | time.sleep(1) 52 | 53 | ---------- 54 | 55 | > Repository 56 | > :[https://github.com/shubham8550/Google-Drive-Torrent-Downlaoder](https://github.com/shubham8550/Google-Drive-Torrent-Downlaoder) 57 | > 58 | > Star My Repository and follow me on Github. 59 | shubham8550/stars-github 60 | -------------------------------------------------------------------------------- /Google_Drive_Torrent_Downlaoder.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "Google Drive Torrent Downlaoder.ipynb", 7 | "provenance": [], 8 | "collapsed_sections": [], 9 | "include_colab_link": true 10 | }, 11 | "kernelspec": { 12 | "name": "python3", 13 | "display_name": "Python 3" 14 | } 15 | }, 16 | "cells": [ 17 | { 18 | "cell_type": "markdown", 19 | "metadata": { 20 | "id": "view-in-github", 21 | "colab_type": "text" 22 | }, 23 | "source": [ 24 | "\"Open" 25 | ] 26 | }, 27 | { 28 | "cell_type": "markdown", 29 | "metadata": { 30 | "id": "vLY_5dVZlogP" 31 | }, 32 | "source": [ 33 | "**Step 1** : install libtorrent Package" 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "metadata": { 39 | "id": "rmnSQDBclGlF" 40 | }, 41 | "source": [ 42 | "!pip3 install libtorrent" 43 | ], 44 | "execution_count": null, 45 | "outputs": [] 46 | }, 47 | { 48 | "cell_type": "markdown", 49 | "metadata": { 50 | "id": "9se-mHyHl8aL" 51 | }, 52 | "source": [ 53 | "**Step 2** : Import libtorrent" 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "metadata": { 59 | "id": "S42qWqHRl5tT" 60 | }, 61 | "source": [ 62 | "import libtorrent as lt" 63 | ], 64 | "execution_count": null, 65 | "outputs": [] 66 | }, 67 | { 68 | "cell_type": "markdown", 69 | "metadata": { 70 | "id": "Jx5Bojvymg2w" 71 | }, 72 | "source": [ 73 | "**Step 3** : Mount your Google Drive" 74 | ] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "metadata": { 79 | "id": "iuDSAqHxmwcL" 80 | }, 81 | "source": [ 82 | "from google.colab import drive\n", 83 | "\n", 84 | "drive.mount('/content/gdrive2')" 85 | ], 86 | "execution_count": null, 87 | "outputs": [] 88 | }, 89 | { 90 | "cell_type": "markdown", 91 | "metadata": { 92 | "id": "zjKLgUKkm32e" 93 | }, 94 | "source": [ 95 | "**Step 4** : Replace your Magnet Link And Run Cell ,And thats It. Have a Fun !!\n" 96 | ] 97 | }, 98 | { 99 | "cell_type": "code", 100 | "metadata": { 101 | "id": "6cH1EPe6nOaG" 102 | }, 103 | "source": [ 104 | "import libtorrent as lt\n", 105 | "import time\n", 106 | "\n", 107 | "ses = lt.session()\n", 108 | "params = { 'save_path': '/content/gdrive2/My Drive'}\n", 109 | "link = \"magnet:?xt=urn:btih:d72af2a6f1b29537399db84a5093287d9a3fecee&dn=Unity-2020.1.16f1\"\n", 110 | "handle = lt.add_magnet_uri(ses, link, params)\n", 111 | "\n", 112 | "print('downloading metadata...')\n", 113 | "while (not handle.has_metadata()): time.sleep(1)\n", 114 | "print('got metadata, starting torrent download...')\n", 115 | "while (handle.status().state != lt.torrent_status.seeding):\n", 116 | " print('%d %% done' % (handle.status().progress*100))\n", 117 | " time.sleep(1)\n", 118 | "print('Finished')\n" 119 | ], 120 | "execution_count": null, 121 | "outputs": [] 122 | }, 123 | { 124 | "cell_type": "markdown", 125 | "metadata": { 126 | "id": "nPTNKn1UnYTe" 127 | }, 128 | "source": [ 129 | "\n", 130 | "\n", 131 | "---\n", 132 | "\n", 133 | "Repository :https://github.com/shubham8550/Google-Drive-Torrent-Downlaoder\n", 134 | "\n", 135 | "Star My Repository and follow me on Github." 136 | ] 137 | } 138 | ] 139 | } 140 | --------------------------------------------------------------------------------