Giter Site home page Giter Site logo

aria-telegram-mirror-bot's Introduction

aria-telegram-mirror-bot

This is a Telegram bot that uses aria2 to download files over BitTorrent / HTTP(S) and uploads them to your Google Drive. This can be useful for downloading from slow servers. Parallel downloading and download queuing are supported. There are some features to try to reduce piracy.

Limitations

This bot is meant to be used in small, closed groups. So, once deployed, it only works in whitelisted groups.

Warning

There is very little preventing users from using this to mirror pirated content. Hence, make sure that only trusted groups are whitelisted in AUTHORIZED_CHATS.

Bot commands

  • /mirror <url>: Download from the given URL and upload it to Google Drive. can be HTTP(S), a BitTorrent magnet, or a HTTP(S) url to a BitTorrent .torrent file. A status message will be shown and updated while downloading.
  • /mirrorTar <url>: Same as /mirror, but archive multiple files into a tar before uploading it.
  • /mirrorStatus: Send a status message about all active and queued downloads.
  • /cancelMirror: Cancel a particular mirroring task. To use this, send it as a reply to the message that started the download that you want to cancel. Only the person who started the task, SUDO_USERS, and chat admins can use this command.
  • /cancelAll: Cancel all mirroring tasks in all chats if a SUDO_USERS member uses it, or cancel all mirroring tasks for a particular chat if one of that chat's admins use it. No one else can use this command.
  • /list <filename> : Send links to downloads with the filename substring in the name. In case of too many downloads, only show the most recent few.
  • /getfolder : Send link of drive mirror folder.

Notes

  • All commands except list can have the bot's username appended to them. See COMMANDS_USE_BOT_NAME under constants description. This is useful if you have multiple instances of this bot in the same group.

  • While creating a Telegram bot in the pre-installation section below, you might want to add the above commands to your new bot by using /setcommand in BotFather, make sure all the commands are in lower case. This will cause a list of available bot commands to pop up in chats when you type /, and you can long press one of them to select it instead of typing out the entire command.

Migrating from v1.0.0

Aria-telegram-mirror-bot is now written in TypeScript. If you are migrating from v1.0.0, move your existing .constants.js to src/.constants.js, and re-read the installation section and the section on updating, as some steps have changed.

Pre-installation

  1. Create a new bot using Telegram's BotFather and copy your TOKEN.

  2. Add the bot to your groups and optionally, give it the permission to delete messages. This permission is used to clean up status request messages from users. Not granting it will quickly fill the chat with useless messages from users.

  3. Install aria2.

    • For Ubuntu: sudo apt install aria2
  4. Get Drive folder ID:

    • Visit Google Drive.
    • Create a new folder. The bot will upload files inside this folder.
    • Open the folder.
    • The URL will be something like https://drive.google.com/drive/u/0/folders/012a_345bcdefghijk. Copy the part after folders/ (012a_345bcdefghijk). This is the GDRIVE_PARENT_DIR_ID that you'll need in step 5 of the Installation section.

Installation

  1. Clone the repo:

    git clone https://github.com/out386/aria-telegram-mirror-bot
    cd aria-telegram-mirror-bot
  2. Run npm install

  3. Copy the example files:

    cp src/.constants.js.example src/.constants.js
    cp aria.sh.example aria.sh
  4. Configure the aria2 startup script:

    • nano aria.sh
    • ARIA_RPC_SECRET is the secret (password) used to connect to aria2. Set this to whatever you want, and save the file with ctrl + x.
    • MAX_CONCURRENT_DOWNLOADS is the number of download jobs that can be active at the same time. Note that this does not affect the number of concurrent uploads. There is currently no limit for the number of concurrent uploads.
  5. Configure the bot:

    • nano src/.constants.js
    • Now replace the placeholder values in this file with your values. Use the Constants description section below for reference.
  6. Set up OAuth:

    • Visit the Google Cloud Console
    • Go to the OAuth Consent tab, fill it, and save.
    • Go to the Credentials tab and click Create Credentials -> OAuth Client ID
    • Choose Other and Create.
    • Use the download button to download your credentials.
    • Move that file to the root of aria-telegram-mirror-bot, and rename it to client_secret.json
  7. Enable the Drive API:

    • Visit the Google API Library page.
    • Search for Drive.
    • Make sure that it's enabled. Enable it if not.
  8. Start aria2 with ./aria.sh

  9. Start the bot with npm start

  10. Open Telegram, and send /mirror https://raw.githubusercontent.com/out386/aria-telegram-mirror-bot/master/README.md to the bot.

  11. In the terminal, it'll ask you to visit an authentication URL. Visit it, grant access, copy the code on that page, and paste it in the terminal.

That's it.

Constants description

This is a description of the fields in src/.constants.js:

  • TOKEN: This is the Telegram bot token that you will get from Botfather in step 1 of Pre-installation.
  • ARIA_SECRET: This is the password used to connect to the aria2 RPC. You will get this from step 4 of Installation.
  • ARIA_DOWNLOAD_LOCATION: This is the directory that aria2 will download files into, before uploading them. Make sure that there is no trailing "/" in this path. The suggested path is /path/to/aria-telegram-mirror-bot/downloads
  • ARIA_DOWNLOAD_LOCATION_ROOT: This is the mountpoint that contains ARIA_DOWNLOAD_LOCATION. This is used internally to calculate the space available before downloading.
  • ARIA_FILTERED_DOMAINS: The bot will refuse to download files from these domains. Can be an empty list.
  • ARIA_FILTERED_FILENAMES: The bot will refuse to completely download (or if already downloaded, then upload) files with any of these substrings in the file/top level directory name. Can be an empty list or left undefined.
  • ARIA_PORT: The port for the Aria2c RPC server. If you change this, make sure to update your aria.sh as well. Safe to leave this at the default value unless something else on your system is using that port.
  • GDRIVE_PARENT_DIR_ID: This is the ID of the Google Drive folder that files will be uploaded into. You will get this from step 4 of Pre-installation.
  • SUDO_USERS: This is a list of Telegram user IDs. These users can use the bot in any chat. Can be an empty list, if AUTHORIZED_CHATS is not empty.
  • AUTHORIZED_CHATS: This is a list of Telegram Chat IDs. Anyone in these chats can use the bot in that particular chat. Anyone not in one of these chats and not in SUDO_USERS cannot use the bot. Someone in one of the chats in this list can use the bot only in that chat, not elsewhere. Can be an empty list, if SUDO_USERS is not empty.
  • STATUS_UPDATE_INTERVAL_MS: Set the time in milliseconds between status updates. A smaller number will update status messages faster, but Telegram will rate limit the bot if it sends/edits more than around 20 messages/minute/chat. As that quota includes messages other than status updates, do not decrease this number if you get rate limit messages in the logs.
  • DRIVE_FILE_PRIVATE: Files uploaded can either be visible to everyone (public), or be private.
    • ENABLED: Set this to true to make the uploaded files private. false makes uploaded files public.
    • EMAILS: An array of email addresses that read access will be granted to. Set this to [] to grant access only to the Drive user the bot is set up with.
  • DOWNLOAD_NOTIFY_TARGET: The fields here are used to notify an external web server once a download is complete. See the section on notifications below for details.
    • enabled: Set this to true to enable this feature.
    • host: The address of the web server to notify.
    • port: The server port ¯\_(ツ)_/¯
    • path: The server path ¯\_(ツ)_/¯
  • COMMANDS_USE_BOT_NAME: The fields here decide whether to append the bot's usename to the end of commands or not. This works only for group chats, and gets ignored if you PM the bot.
    • ENABLED: If true, all bot commands have to have the bot's username (as below) appended to them. For example, /mirror https://someweb.site/resource.tar will become /mirror@botName_bot https://someweb.site/resource.tar. The only exception to this is the /list command, which will not have the bot's name appended. This allows having multiple non-conflicting mirror bots in the same group, and have them all reply to /list.
    • NAME: The username of the bot, as given in BotFather. Include the leading "@".
  • IS_TEAM_DRIVE: Set to true if you are mirroring to a Shared Drive.

Starting after installation

After the initial installation, use these instructions to (re)start the bot.

Using tmux

  1. Start aria2 by running ./aria.sh
  2. Start a new tmux session with tmux new -s tgbot, or connect to an existing session with tmux a -t tgbot. Running the bot inside tmux will let you disconnect from the server without terminating the bot. You can also use nohup instead.
  3. Start the bot with npm start

Using systemd

  1. Install the systemd unit file sudo cp -v contrib/mirror-bot.service /etc/systemd/system/
  2. Open /etc/systemd/system/mirror-bot.service with an editor of your choice and modify the path and user as per your environment.
  3. Reload the systemctl daemon so it can see your new systemd unit sudo systemctl daemon-reload
  4. Start the service sudo systemctl start mirror-bot
  5. If you want the bot to automatically start on boot, run sudo systemctl enable mirror-bot

Notifying an external webserver on download completion

This bot can make an HTTP request to an external web server once a download is complete. This can be when a download fails to start, fails to download, is cancelled, or completes successfully. See the section on constants for details on how to configure it.

Your web server should listen for a POST request containing the following JSON data:

{
    'successful': boolean,
    'file': {
        'name': string,
        'driveURL': string,
        'size': string
    },
    originGroup: number
}
  • successful: true if the download completed successfully, false otherwise
  • file: Details about the file.
    • name: The name of the file. Might or might not be present if successful is false.
    • driveURL: The Google Drive download link to the downloaded file. Might or might not be present if successful is false.
    • size: A human-readable file size. Might or might not be present if successful is false.
  • originGroup: The Telegram chat ID for the chat the download was started in

If successful is false, any or all of the fields of file might be absent. However, if present, they are correct/reliable.

Updating

Run git pull, then run tsc. After compilation has finished, you can start the bot as described in the above section.

Common issues

  • tsc silently dies, says, "Killed", or stays stuck forever: Your machine does not have enough RAM. tsc needs at least 1GB. Increase your RAM if running on the cloud, or try setting up a swap with a high swappiness.

  • Trying to download anything gives a "Failed to start the download. Unauthorized" message: See #38. If it still doesn't work, something else might be running an aria2 RPC at the same port as the bot. Change ARIA_PORT and try #38 again.

  • tsc gives errors like Property 'SOMETHING' does not exist on type<...> with red lines under constants.<...>: Some new configs were added to constants after you set up the bot, but your existing ./src/.constants.js does not have them. Re-read the constants section, and add whatever property was added. Usually, you can also just ignore these particular errors and keep using the bot, because tsc will compile anyway, and there are default options that are used if you did not update your .constants.js.

  • Cannot get public links for folders if using Shared Drives: Shared Drives do not support sharing folders to non members. The download link the bot gives only works for members of the Shared drive. If you need public links, use /mirrorTar to mirror the folder as a single file instead.
    This feature is planned. See upcoming releases (search for "Folder sharing in shared drives").

License

The MIT License (MIT)

Copyright © 2020 out386

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

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.

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?

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".

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

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

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?

when trying to run ./aria.sh

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

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!

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

Telegram Files

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

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

[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.

Enhancement

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

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.

Getting ECONNRESET

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

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 .

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.

Failed to upload

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

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

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>`

seeding time

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

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

[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 :)

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

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

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

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

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

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?

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

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.
`

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:

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

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.