├── .github └── FUNDING.yml ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── index.js ├── package-lock.json └── package.json /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [theabbie] 2 | patreon: theabbie 3 | open_collective: theabbie 4 | ko_fi: theabbie 5 | tidelift: npm/theabbie 6 | liberapay: theabbie 7 | issuehunt: theabbie 8 | otechie: theabbie 9 | custom: ['https://theabbie.github.io', 'https://paypal.me/theabbie','https://donorbox.org/theabbie'] 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "12.13" 4 | 5 | deploy: 6 | provider: npm 7 | email: "${EMAIL}" 8 | api_key: "${NPM}" 9 | on: 10 | branch: main 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Abhishek Chaudhary 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 | # Seedr.cc API 2 | ![seedr.cc](https://user-images.githubusercontent.com/17960677/97034774-0b55bf00-1583-11eb-9529-807646a216de.png) 3 | 4 | 5 | 6 | Unofficial API wrapper for seedr.cc 7 | ## Example 8 | The Following Code snipet will help you understand how to use this. 9 | 10 | ```js 11 | var Seedr = require("seedr"); 12 | var seedr = new Seedr(); 13 | await seedr.login("email@example.com","password"); 14 | await seedr.addMagnet("magnet_link"); 15 | // Starts downloading, wait till that happens 16 | var contents = await seedr.getVideos(); 17 | // An object containing list of all files and folders 18 | ``` 19 | 20 | ## Documentation 21 | 22 | ### Logging in 23 | 24 | There are two ways to login, that is, 25 | 26 | * using username and password 27 | * using device code 28 | 29 | the username and password method returns a token with short lifetime while device id method returns a 1 year lifetime token. 30 | 31 | ```js 32 | var Seedr = require("seedr"); 33 | var seedr = new Seedr(); 34 | await seedr.login("email@example.com","password"); 35 | ``` 36 | 37 | ![Seedr.cc Devices](https://user-images.githubusercontent.com/17960677/97114270-95359180-1715-11eb-91f1-59273a488ca5.png) 38 | 39 | ```js 40 | var Seedr = require("seedr"); 41 | var seedr = new Seedr(); 42 | await seedr.getDeviceCode(); 43 | // prints a device code and user code, go to seedr.cc/devices and add user code 44 | // after adding user code, pass the device code parameter to getToken function 45 | 46 | await seedr.getToken("device_code"); 47 | // returns a token with 1 year lifetime 48 | ``` 49 | 50 | ** using an old token to log in directly ** 51 | 52 | ```js 53 | var Seedr = require("seedr"); 54 | var seedr = new Seedr(); 55 | await seedr.addToken("token"); 56 | ``` 57 | ### Adding magnet link 58 | 59 | Magnet link can be added using `addMagnet` function 60 | 61 | ```js 62 | var Seedr = require("seedr"); 63 | var seedr = new Seedr(); 64 | await seedr.login("email@example.com","password"); 65 | 66 | await seedr.addMagnet("magnet_link"); 67 | 68 | // adds a magnet link, wait till it downloads 69 | ``` 70 | 71 | ### Getting contents 72 | 73 | To get contents (only videos), use the `getVideos` function 74 | 75 | ```js 76 | var Seedr = require("seedr"); 77 | var seedr = new Seedr(); 78 | await seedr.login("email@example.com","password"); 79 | 80 | await seedr.getVideos(); 81 | 82 | /* 83 | Prints Array of Arrays with file data 84 | 85 | [ 86 | [ 87 | { 88 | "fid": 124291671, // folder id 89 | "id": 636235280, // file id 90 | "name": "File Name" 91 | }, 92 | ... 93 | ], 94 | ... 95 | ] 96 | */ 97 | ``` 98 | ### Deleting contents 99 | 100 | To delete Folders use `deleteFolder` function and to delete files, use `deleteFiles` function 101 | 102 | ```js 103 | var Seedr = require("seedr"); 104 | var seedr = new Seedr(); 105 | await seedr.login("email@example.com","password"); 106 | 107 | await seedr.deleteFile("file_id"); 108 | 109 | await seedr.deleteFolder("folder_id"); 110 | ``` 111 | 112 | ## Contributing 113 | 114 | Thank you for your interest in contributing, If you feel like there's something missing or any new feature can be added, just create a PR and I will see the rest. 115 | 116 | ## Help 117 | 118 | You can contact me on social media, Everything about me can be found [here](https://theabbie.github.io) 119 | 120 | ## Installation 121 | 122 | ### Requirements 123 | 124 | * Node.Js installed 125 | 126 | ### Dev Dependencies 127 | 128 | * Axios 129 | 130 | ## Credits 131 | 132 | * [Seedr.cc](https://seedr.cc) For making an excellent tool 133 | 134 | ## Contact 135 | 136 | Contact me anywhere, just visit [my portfolio](https://theabbie.github.io) 137 | 138 | ## License 139 | 140 | This project is licensed under MIT License, See [LICENSE](/LICENSE) for more information 141 | 142 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var axios = require("axios"); 2 | var FormData = require('form-data'); 3 | 4 | module.exports = class Seedr { 5 | constructor() {} 6 | 7 | async login(username, password) { 8 | this.username = username; 9 | this.password = password; 10 | var data = new FormData(); 11 | data.append('grant_type', 'password'); 12 | data.append('client_id', 'seedr_chrome'); 13 | data.append('type', 'login'); 14 | data.append('username', this.username); 15 | data.append('password', this.password); 16 | var token = await axios({ 17 | method: 'post', 18 | url: 'https://www.seedr.cc/oauth_test/token.php', 19 | headers: data.getHeaders(), 20 | data: data 21 | }); 22 | this.token = token.data["access_token"]; 23 | this.rft = token.data["refresh_token"]; 24 | return this.token; 25 | } 26 | 27 | async getDeviceCode() { 28 | var dc = await axios("https://www.seedr.cc/api/device/code?client_id=seedr_xbmc"); 29 | this.devc = dc.data["device_code"]; 30 | this.usc = dc.data["user_code"]; 31 | console.log(`Paste this code into Seedr ${this.usc} || And here is your token ${this.devc}`); 32 | return this.usc; 33 | } 34 | 35 | async getToken(devc) { 36 | var token = await axios("https://www.seedr.cc/api/device/authorize?device_code=" + devc + "&client_id=seedr_xbmc"); 37 | this.token = token.data["access_token"]; 38 | return this.token; 39 | } 40 | 41 | async addToken(token) { 42 | this.token = token; 43 | } 44 | 45 | async addMagnet(magnet) { 46 | var data = new FormData(); 47 | data.append('access_token', this.token); 48 | data.append('func', 'add_torrent'); 49 | data.append('torrent_magnet', magnet); 50 | 51 | var res = await axios({ 52 | method: 'post', 53 | url: 'https://www.seedr.cc/oauth_test/resource.php', 54 | headers: data.getHeaders(), 55 | data: data 56 | }); 57 | return res.data; 58 | } 59 | 60 | async getVideos() { 61 | var res = []; 62 | 63 | var data = await axios("https://www.seedr.cc/api/folder?access_token=" + this.token); 64 | 65 | for (var folder of data.data.folders) { 66 | res.push((await axios("https://www.seedr.cc/api/folder/" + folder.id + "?access_token=" + this.token)).data.files.filter(x => x["play_video"]).map(x => { 67 | return { 68 | fid: folder.id, 69 | id: x["folder_file_id"], 70 | name: x.name 71 | } 72 | })); 73 | } 74 | 75 | return res; 76 | } 77 | 78 | async getFile(id) { 79 | var data = new FormData(); 80 | data.append('access_token', this.token); 81 | data.append('func', 'fetch_file'); 82 | data.append('folder_file_id', id); 83 | 84 | var res = await axios({ 85 | method: 'post', 86 | url: 'https://www.seedr.cc/oauth_test/resource.php', 87 | headers: data.getHeaders(), 88 | data: data 89 | }); 90 | return res.data; 91 | } 92 | 93 | async deleteFolder(id) { 94 | var data = new FormData(); 95 | data.append('access_token', this.token); 96 | data.append('func', 'delete'); 97 | data.append('delete_arr', JSON.stringify([{ 98 | type: 'folder', 99 | id: id 100 | }])); 101 | 102 | var res = await axios({ 103 | method: 'post', 104 | url: 'https://www.seedr.cc/oauth_test/resource.php', 105 | headers: data.getHeaders(), 106 | data: data 107 | }); 108 | return res.data; 109 | } 110 | 111 | async deleteFile(id) { 112 | var data = new FormData(); 113 | data.append('access_token', this.token); 114 | data.append('func', 'delete'); 115 | data.append('delete_arr', JSON.stringify([{ 116 | type: 'file', 117 | id: id 118 | }])); 119 | 120 | var res = await axios({ 121 | method: 'post', 122 | url: 'https://www.seedr.cc/oauth_test/resource.php', 123 | headers: data.getHeaders(), 124 | data: data 125 | }); 126 | return res.data; 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "seedr", 3 | "version": "1.1.2", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "asynckit": { 8 | "version": "0.4.0", 9 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 10 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 11 | }, 12 | "axios": { 13 | "version": "0.21.1", 14 | "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", 15 | "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", 16 | "requires": { 17 | "follow-redirects": "^1.10.0" 18 | } 19 | }, 20 | "combined-stream": { 21 | "version": "1.0.8", 22 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 23 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 24 | "requires": { 25 | "delayed-stream": "~1.0.0" 26 | } 27 | }, 28 | "delayed-stream": { 29 | "version": "1.0.0", 30 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 31 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 32 | }, 33 | "follow-redirects": { 34 | "version": "1.13.3", 35 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz", 36 | "integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==" 37 | }, 38 | "form-data": { 39 | "version": "3.0.0", 40 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", 41 | "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", 42 | "requires": { 43 | "asynckit": "^0.4.0", 44 | "combined-stream": "^1.0.8", 45 | "mime-types": "^2.1.12" 46 | } 47 | }, 48 | "mime-db": { 49 | "version": "1.44.0", 50 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", 51 | "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" 52 | }, 53 | "mime-types": { 54 | "version": "2.1.27", 55 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", 56 | "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", 57 | "requires": { 58 | "mime-db": "1.44.0" 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "seedr", 3 | "version": "1.1.2", 4 | "description": "Unofficial API wrapper for seedr.cc", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"working\"" 8 | }, 9 | "funding": "https://theabbie.github.io", 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/theabbie/seedr-api.git" 13 | }, 14 | "keywords": [ 15 | "seedr" 16 | ], 17 | "author": "theabbie", 18 | "license": "ISC", 19 | "bugs": { 20 | "url": "https://github.com/theabbie/seedr-api/issues" 21 | }, 22 | "homepage": "https://github.com/theabbie/seedr-api#readme", 23 | "dependencies": { 24 | "axios": "^0.21.1", 25 | "form-data": "^3.0.0" 26 | } 27 | } 28 | --------------------------------------------------------------------------------