Coder Social home page Coder Social logo

out386 / aria-telegram-mirror-bot Goto Github PK

View Code? Open in Web Editor NEW
519.0 519.0 403.0 186 KB

A Telegram bot to download files via HTTP(S)/BitTorrent and upload them to Google Drive

License: MIT License

Shell 0.91% TypeScript 97.91% JavaScript 1.17%

aria-telegram-mirror-bot's People

Contributors

a092devs avatar akhilnarang avatar akianonymus avatar genos2000 avatar gotenksin avatar jashasweejena avatar msfjarvis avatar nealgosalia avatar nishithkhanna avatar out386 avatar yash-garg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aria-telegram-mirror-bot's Issues

When i type npm start

[email protected] start C:\Windows\System32\aria-telegram-mirror-bot
NTBA_FIX_319=1 node --max_old_space_size=128 ./out/index.js

'NTBA_FIX_319' not recognized as an internal or external command, operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: 'NTBA_FIX_319=1 node --max_old_space_size=128 ./out/index.js'
npm ERR! Exit status 1
npm ERR! failed at the [email protected] start script
npm ERR! this is probably not a problem with npm. There is likely additional logging above output above

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\plt\Appdata\Roaming\npm-cache_logs\2020-02-01T18_24_18_01_8Z-debug.log

How to solve it?

Polling error

error: [polling_error] {"code":"ETELEGRAM","message":"ETELEGRAM: 409 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running"}

How do I fix this?

error at npm

npm --max_old_space_size=128 start

[email protected] start /home/yogesh/aria-telegram-mirror-bot
node index.js

internal/modules/cjs/loader.js:583
throw err;
^

Error: Cannot find module 'node-telegram-bot-api'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object. (/home/yogesh/aria-telegram-mirror-bot/index.js:1:83)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2018-10-05T17_17_18_825Z-debug.log

no response in bot after sending auth url

hello i configured this script in my server but finally i got some warning message like
node telegram bot api got deprecated and need to enable manually with this link
yagop/node-telegram-bot-api#319.

is it possible to run this script in windows 10 ,with node ,
if you can provide some tutorials or videos shows the configuration part would be helpful .
thank you

seeding time

is it possible to manually choose seed time at the time of adding a torrent into bot

Blocked Torrent Sites

['yts', 'YTS', 'cruzing.xyz', 'eztv.ag', 'YIFY'], // Prevent downloading from URLs containing these substrings

Why these sites are blocked means these strings or name is there any specific reason, if i want to download anything from these torrent sites.

Cannot upload to Team-Drives

I tried putting up my team drive folder ID but it does not works !!

Log below :

download:https://raw.githubusercontent.com/Yash-Garg/scripts/master/README.mkdn gid:15948ac98dd005bb
start 15948ac98dd005bb
onDownloadComplete: /home/yashg/MirrorUploads/README.mkdn
processFileOrDir: /home/yashg/MirrorUploads/README.mkdn
Uploading file README.mkdn to Google drive.
Got file id null
uploadFile: deleting
uploadFile: /home/yashg/MirrorUploads/README.mkdn: {}
cleanupDownload: deleting

Permission Denied for deleting file once downloaded on to Drive.

gid: 9d4f2def55660f5f download:https://raw.githubusercontent.com/out386/aria-telegram-mirror-bot/master/README.md
9d4f2def55660f5f: Started. Dir: 2efb4cb5-3df9-40b9-a2b9-d312aab9ac66.
9d4f2def55660f5f: Completed. Filename: README.md. Starting upload.
9d4f2def55660f5f: Uploaded 
**cleanup: Failed to delete 2efb4cb5-3df9-40b9-a2b9-d312aab9ac66: EACCES: permission denied, unlink '/data/2efb4cb5-3df9-40b9-a2b9-d312aab9ac66/README.md'**

Since it's unable to delete the files, the storage get filled pretty quickly.
I tried giving read and write access to the /data folder using the following command.

  1. sudo chmod -R 777 "/data"

Let me know how can I solve this issue.

Telegram Files

Can you add modules to mirror telegram files using the bot?

ECONNREFUSED on Termux

Hii I am just new to this and Tried to delpoy this mirror bot I am using Termux and do all the steps as written and when I Do a mirror command on bot getting this error attached screen shot.
Screenshot_20191101-152957
Screenshot_20191101-153321

Finding own user ID

`src/.constants.js:10:27 - error TS1136: Property assignment expected.

10 SUDO_USERS: [012, 345], @// Telegram user IDs. These users can use the bot in any chat.
~

src/.constants.js:10:27 - error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.

10 SUDO_USERS: [012, 345], @// Telegram user IDs. These users can use the bot in any chat.
~~~~~~~~~

src/.constants.js:10:36 - error TS1146: Declaration expected.

10 SUDO_USERS: [012, 345], // Telegram user IDs. These users can use the bot in any chat.

src/.constants.js:12:28 - error TS1005: ';' expected.

12 STATUS_UPDATE_INTERVAL_MS: 12000, // A smaller number will update faster, but might cause rate limiting
~

src/.constants.js:13:21 - error TS1005: ';' expected.

13 DRIVE_FILE_PRIVATE: {
~

src/.constants.js:15:11 - error TS1005: ';' expected.

15 EMAILS: ['']
~

src/.constants.js:16:4 - error TS1128: Declaration or statement expected.

16 },
~

src/.constants.js:19:9 - error TS1005: ';' expected.

19 host: 'hostname.domain',
~

src/.constants.js:20:9 - error TS1005: ';' expected.

20 port: 80,
~

src/.constants.js:21:9 - error TS1005: ';' expected.

21 path: '/botNotify'
~

src/.constants.js:22:4 - error TS1128: Declaration or statement expected.

22 },
~

src/.constants.js:25:9 - error TS1005: ';' expected.

25 NAME: "@MaMa"
~

src/.constants.js:26:4 - error TS1128: Declaration or statement expected.

26 },
~

src/.constants.js:28:1 - error TS1128: Declaration or statement expected.

28 });
~

src/.constants.js:28:2 - error TS1128: Declaration or statement expected.

28 });
~

Found 15 errors.
`

Enhancement

when will download queuing added to the Bot. Eagerly waiting for that feature

when trying to run ./aria.sh

aria2c: unrecognized option '--rpc-secret=1234567890'
Usage: aria2c [OPTIONS] [URI | MAGNET | TORRENT_FILE | METALINK_FILE]...
See 'aria2c -h'.

need help

after run npm --max_old_space_size=128 start i got this

run in : windows 10

`C:\Users\user\Downloads\PHYTON\aria-telegram-mirror-bot>npm --max_old_space_size=128 start

[email protected] start C:\Users\user\Downloads\PHYTON\aria-telegram-mirror-bot
NTBA_FIX_319=1 node --max_old_space_size=128 ./out/index.js

'NTBA_FIX_319' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: NTBA_FIX_319=1 node --max_old_space_size=128 ./out/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache_logs\2019-10-14T11_38_01_279Z-debug.log

C:\Users\user\Downloads\PHYTON\aria-telegram-mirror-bot>`

New feature suggestions

Hello , is it possible to directly download the file from url to google drive via drive api url to drive function with the help of google app script ,so we can cut the server , and make this as a server-less one

looking for possibility: This node telegram git uses telegram client api right or bot api , if it is client api then we can modify its downloading limit and make this bot to mirror from telegram also right? and make take the file outside telegram servers like what @getpubliclinkbot do ,

as far i understand their concept is they modified the client api limit and forward the file they receive
in bot with the file ids to their servers and upload that to google drive ,

Menu needed or intro needed ,right now empty response when we start the bot ,,using the menu we need to configure various features ,

the google drive auth url is happening in server side , if possible make it in client side ,

IF possible make the bot to use by public,
and make a full capability bot , by helping to download torrents as well act as a download manager and make google drive urls by mirroring telegram files also , may we can implement into a website which can get files from the server with out hosting file in any hosting site , many files are now in telegram cloud but as far i now there is no site providing a direct download option from telegram cloud servers \

so if possible extend the capabilities of this bot ,
just suggestion , you can ignore if its just doesn't make sense ,
thank you .

help Please

[email protected] start /root/aria-telegram-mirror-bot
NTBA_FIX_319=1 node --max_old_space_size=128 ./out/index.js

/root/aria-telegram-mirror-bot/node_modules/googleapis/build/src/googleapis.js:93
async discoverAsync(url) {
^^^^^^^^^^^^^
SyntaxError: Unexpected identifier
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/root/aria-telegram-mirror-bot/node_modules/googleapis/build/src/index.js:19:22)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/root/aria-telegram-mirror-bot/out/drive/drive-auth.js:5:22)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

npm ERR! Linux 5.0.0-17-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: NTBA_FIX_319=1 node --max_old_space_size=128 ./out/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'NTBA_FIX_319=1 node --max_old_space_size=128 ./out/index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the mirror-bot package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! NTBA_FIX_319=1 node --max_old_space_size=128 ./out/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs mirror-bot
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls mirror-bot
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /root/aria-telegram-mirror-bot/npm-debug.log

A2C: Failed to open websocket

> [email protected] start /home/administrator/aria-telegram-mirror-bot
> node index.js

node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated.
In the future, you will have to enable it yourself.
See https://github.com/yagop/node-telegram-bot-api/issues/319. module.js:652:30
A2C: Failed to open websocket. Exiting.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-05-05T18_20_39_767Z-debug.log

Dir Failed

I tried setting up everything from the README but I'm still getting this error for some reason. I tried changing the download directory in constants.js but same error.

A2C: Websocket opened. Bot ready.
download:https://raw.githubusercontent.com/out386/aria-telegram-mirror-bot/master/README.md gid:765a80751222be8d
Started 765a80751222be8d. Dir: 0c10a633-5b6d-404a-a4f0-74604c138a6b.
765a80751222be8d failed. Download aborted.
cleanup: Deleted 0c10a633-5b6d-404a-a4f0-74604c138a6b

download:https://raw.githubusercontent.com/out386/aria-telegram-mirror-bot/master/README.md gid:45ec985705c9ea33
Started 45ec985705c9ea33. Dir: f83ce242-a223-4979-a7e0-b4b62ebe30f9.
45ec985705c9ea33 failed. Download aborted.
cleanup: Deleted f83ce242-a223-4979-a7e0-b4b62ebe30f9

Bulk Upload

Hello Dev I tried your bot Today. It's very useful. But I'm facing one problem. I need to upload lot's of files but this bot supports only 1 link in each message. It'll be great help if you add a feature to bulk upload so that we can send 30-50 direct links in one message to the telegram bot & it bulk uploads all the files. Thank you so much.

Another thing I noticed that after uploading the file the telegram bot gives hyper links only. If you add both hyperlink & plain link it'll be useful for some people. Thank u

get this error earlier was not there

undefined:1

^

SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse ()
at fs.readFile (/home/bronx909/aria-telegram-mirror-bot/drive/drive-auth.js:16:20)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-02-05T10_28_00_396Z-debug.log

Using Bot name

Bot isn't responding /mirror cmd if COMMANDS_USE_BOT_NAME: is kept true. If it's kept for false it will not respond of other cmd default by telegram.. So its better to make /mirror too not to have username after the command.. Thank you.. hope you got it!

[Feature Request] Different folders for different Sudos

Hello, I have been using this bot from a long time and it's going great.
I'd like to request a new feature where in we can have different folders for different sudo users so it doesn't mess with the other sudo users files/folders
It'd be great if you could add it.
Thanks :)

Cannot find module 'node-telegram-bot-api'

npm --max_old_space_size=128 start

[email protected] start /root/aria-telegram-mirror-bot
node index.js

module.js:478
throw err;
^

Error: Cannot find module 'node-telegram-bot-api'
at Function.Module._resolveFilename (module.js:476:15)
at Function.Module._load (module.js:424:25)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/root/aria-telegram-mirror-bot/index.js:1:83)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)

npm ERR! Linux 3.10.0-957.10.1.el7.x86_64
npm ERR! argv "/usr/bin/node" "/bin/npm" "--max_old_space_size=128" "start"
npm ERR! node v6.16.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the mirror-bot package,
npm ERR! not with npm itself.
npm ERR! node index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs mirror-bot
npm ERR! Or if that isn't available, you can get their info via:

Request Feature

Hello,

Can you add feature to limit file size torrent? example if sudo user can get unlimited file size , if another user max file size 1 Gb.

Is this possible to implement feature like this?

Thanks.

when same torrent file downloading 2 users simultaneosly it gives error

when same torrent file downloading 2 users simultaneosly...
download get cancelled or something and link never appears

Solution

Let say I added a torrent and leeched to 50%.
Then you added the same, the bot send you the status (50%) to you. Then it register 2 users on that torrent.
So when I deleted the torrent, it will delete the ownership, but not the torrent. Because you still own the torrent.

So give the torrent status to the user instead of failure message

url shortener integration

is there any way to integrate URL shortener using their API

eg: short link before posting to telegram group using bit.ly API or shorte.st API

[Feature Request] Tar Extractor

Allowing users to provide bot a direct URL and extracting the provided file (provided via the URL) and uploading it into a gDrive Folder.

everytime i try to setup bot this issue appears

is deprecated.
In the future, you will have to enable it yourself.
See yagop/node-telegram-bot-api#319. module.js:652:30
A2C: Websocket opened
download:https://raw.githubusercontent.com/out386/aria-telegram-mirror-bot/master/README.md gid:a91573934c846ba3
start a91573934c846ba3
error a91573934c846ba3
cleanupDownload: deleting
download:https://a.uguu.se/A5V8pixUxJ_client_secret.json gid:112d173517308acb
start 112d173517308acb
error 112d173517308acb
cleanupDownload: deleting

problem with new version

stuck at
Compile the project by running tsc
when the run the command it stays there forever
any idea how long it takes to compile

Website Phel

When someone mirrors a website (e.g https://del.dog/d9pregj) the download doesn't start (no shit sherlock) but I am unable to mirror again until I restart the bot

Failed to upload

It sends msg that failed to upload ******** to drive.Error: invalid_request

Doesn't upload: Get drive resumable url return invalid headers

Hi
I need help resolving this issue. Progress bar working fine, file downloads and then I get this:
Failed to upload debian-10.2.0-amd64-DVD-1.iso to Drive. Get drive resumable url return invalid headers: { "x-guploader-uploadid": "AEnB2UrHurd0MwwFdh_LNxc12uDwN1IfmoHjzz1J2COlqrIuLrjb6R-Y2oP7Ucb7sZmoXC0Lq14HLWV9PAwbwsl_ZJ3Sbrhvdritguc0OvnGS6DHkvuss0I", "vary": "Origin, X-Origin", "content-type": "application/json; charset=UTF-8", "content-length": "215", "date": "Fri, 17 Jan 2020 08:53:35 GMT", "server": "UploadServer", "alt-svc": "quic=\":443\"; ma=2592000; v=\"46,43\",h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000", "connection": "close" }
Tried it multiple time and every time it's content-length": "215".

Getting ECONNRESET

Getting Failed to upload File_Name to Drive.read ECONNRESET error while uploading larger files. approx 20-30GB

Polling Issue Continued

I have not started any other bot instance. Still I am facing this error. Any way I can stop all t
he instances?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.