Giter VIP home page Giter VIP logo

jagrit007 / telegram-clonebot Goto Github PK

View Code? Open in Web Editor NEW
323.0 12.0 456.0 42 KB

[USE ALPHA BRANCH] Simple Bot to clone Google Drive Files (or Folders) to your Team Drive[or Normal Drive]. P.S This is not a Mirror Bot. Enjoy โœŒ๐Ÿป

License: MIT License

Python 99.97% Shell 0.03%
team-drive google-drive autorclone gdrive-folder bot telegram telegram-bot python gclone clonebot

telegram-clonebot's People

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

telegram-clonebot's Issues

HI! error

When i run the /clone ID
The bot was cloning but sende massive mesagges wit (HI!) too much..

Error while using Service Accounts

Logs while USE_SERVICE_ACCOUNTS is true

2020-10-09T12:00:29.359005+00:00 app[worker.1]: 2020-10-09 12:00:29,358 - bot - INFO - Authorizing with 0.json service account
2020-10-09T12:00:29.608422+00:00 app[worker.1]: 2020-10-09 12:00:29,608 - bot - INFO - File ID: 10MJ2vwavNELczT2nMvjKghcFft8tTfdC
2020-10-09T12:00:32.639252+00:00 app[worker.1]: 2020-10-09 12:00:32,638 - bot - ERROR - Message to edit not found

Message from telegram (Clone Unsuccessful)

HttpError 404 when requesting https://www.googleapis.com/drive/v3/files/10MJ2vwavNELczT2nMvjKghcFft8tTfdC?supportsAllDrives=true&fields=name%2Cid%2CmimeType%2Csize&alt=json returned "File not found: 10MJ2vwavNELczT2nMvjKghcFft8tTfdC."

Logs while USE_SERVICE_ACCOUNTS is false (Clone Successful)

2020-10-09T12:06:40.531246+00:00 app[worker.1]: 2020-10-09 12:06:40,530 - bot - ERROR - Can't parse entities: can't find end of the entity starting at byte offset 248
2020-10-09T12:06:45.553824+00:00 app[worker.1]: 2020-10-09 12:06:45,553 - bot - ERROR - Can't parse entities: can't find end of the entity starting at byte offset 325
2020-10-09T12:06:50.578583+00:00 app[worker.1]: 2020-10-09 12:06:50,578 - bot - ERROR - Can't parse entities: can't find end of the entity starting at byte offset 256
2020-10-09T12:06:55.601809+00:00 app[worker.1]: 2020-10-09 12:06:55,601 - bot - ERROR - Can't parse entities: can't find end of the entity starting at byte offset 310
2020-10-09T12:08:35.554561+00:00 app[worker.1]: 2020-10-09 12:08:35,554 - googleapiclient.http - WARNING - Encountered 403 Forbidden with reason "userRateLimitExceeded"
2020-10-09T12:08:37.441123+00:00 app[worker.1]: 2020-10-09 12:08:37,440 - bot - ERROR - Message to edit not found

cloneBot needs

Hi, I'm trying to make the bot and I can't.
I would like to know if you provide the service of carrying it out or of assistance,
I need this bot to make copies of my content systematically, I am very interested

Heroku ERROR

this is my heroku logs:

2021-04-27T18:27:17.132784+00:00 app[worker.1]: 2021-04-27 18:27:17,131 - telegram.utils.promise - ERROR - An uncaught error was raised while running the promise
2021-04-27T18:27:17.132798+00:00 app[worker.1]: Traceback (most recent call last):
2021-04-27T18:27:17.132809+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/telegram/utils/promise.py", line 57, in run
2021-04-27T18:27:17.132811+00:00 app[worker.1]: self._result = self.pooled_function(*self.args, **self.kwargs)
2021-04-27T18:27:17.132811+00:00 app[worker.1]: File "/app/bot/decorators.py", line 7, in wrapper
2021-04-27T18:27:17.132812+00:00 app[worker.1]: if args[0].effective_message.from_user.id in AUTHORISED_USERS or args[0].message.chat_id in AUTHORISED_USERS:
2021-04-27T18:27:17.132812+00:00 app[worker.1]: TypeError: argument of type 'int' is not iterable

Username and buttons

New Features Request

  1. Add Support Of Buttons For Drive And index link
    2.And add username support of the uploader

HttpError 404 when requesting

Error when i can clone

HttpError 404 when requesting https://www.googleapis.com/drive/v3/files/1VwHyP_L8OXSYJVZMaX3iW34b7q5uHCzp?supportsAllDrives=true&fields=name%2Cid%2Csize&alt=json returned "File not found: 1VwHyP_L8OXSYJVZMaX3iW34b7q5uHCzp."

Al parecer no encuentra la carpeta destino, y el link me manda a que debo iniciar sesion para que funcione

{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
}

Encountered 403 error

2022-01-23T15:35:45.165691+00:00 app[worker.1]: 2022-01-23 15:35:45,165 - googleapiclient.http - WARNING - Encountered 403 Forbidden with reason "teamDrivesSharingRestrictionNotAllowed" 2022-01-23T15:35:51.889428+00:00 app[worker.1]: 2022-01-23 15:35:51,889 - googleapiclient.http - WARNING - Encountered 403 Forbidden with reason "teamDrivesSharingRestrictionNotAllowed" 2022-01-23T15:35:58.507440+00:00 app[worker.1]: 2022-01-23 15:35:58,507 - googleapiclient.http - WARNING - Encountered 403 Forbidden with reason "teamDrivesSharingRestrictionNotAllowed" 2022-01-23T15:36:05.078522+00:00 app[worker.1]: 2022-01-23 15:36:05,078 - googleapiclient.http - WARNING - Encountered 403 Forbidden with reason "teamDrivesSharingRestrictionNotAllowed" 2022-01-23T15:36:11.670738+00:00 app[worker.1]: 2022-01-23 15:36:11,670 - googleapiclient.http - WARNING - Encountered 403 Forbidden with reason "teamDrivesSharingRestrictionNotAllowed" 2022-01-23T15:36:18.317766+00:00 app[worker.1]: 2022-01-23 15:36:18,317 - googleapiclient.http - WARNING - Encountered 403 Forbidden with reason "teamDrivesSharingRestrictionNotAllowed" 2022-01-23T15:36:24.910884+00:00 app[worker.1]: 2022-01-23 15:36:24,910 - googleapiclient.http - WARNING - Encountered 403 Forbidden with reason "teamDrivesSharingRestrictionNotAllowed" 2022-01-23T15:36:31.497982+00:00 app[worker.1]: 2022-01-23 15:36:31,497 - googleapiclient.http - WARNING - Encountered 403 Forbidden with reason "teamDrivesSharingRestrictionNotAllowed" 2022-01-23T15:36:31.505162+00:00 app[worker.1]: 2022-01-23 15:36:31,504 - bot - INFO - Total Attempts: 15 2022-01-23T15:36:31.505392+00:00 app[worker.1]: 2022-01-23 15:36:31,505 - bot - ERROR - <HttpError 403 when requesting https://www.googleapis.com/drive/v3/files/1PcrIlzJ07zylQZOnPzxeiI2Yz-2LtPSS/copy?supportsAllDrives=true&alt=json returned "Sharing restrictions cannot be set on a shared drive item.">

Can i know where is the problem is?

Timeout Error :(

Tried Coping 8TB and it throws Timeout Error.

Logs :-

2020-07-29T12:39:14.692732+00:00 app[worker.1]: An uncaught error was raised while running the promise
2020-07-29T12:39:14.692742+00:00 app[worker.1]: Traceback (most recent call last):
2020-07-29T12:39:14.692742+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.7/site-packages/telegram/utils/promise.py", line 56, in run
2020-07-29T12:39:14.692743+00:00 app[worker.1]: self._result = self.pooled_function(*self.args, **self.kwargs)
2020-07-29T12:39:14.692743+00:00 app[worker.1]: File "clonerbot.py", line 158, in clone
2020-07-29T12:39:14.692744+00:00 app[worker.1]: message.edit_text(to_send)
2020-07-29T12:39:14.692744+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.7/site-packages/telegram/message.py", line 876, in edit_text
2020-07-29T12:39:14.692745+00:00 app[worker.1]: chat_id=self.chat_id, message_id=self.message_id, *args, **kwargs)
2020-07-29T12:39:14.692745+00:00 app[worker.1]: File "", line 2, in edit_message_text
2020-07-29T12:39:14.692745+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.7/site-packages/telegram/bot.py", line 67, in decorator
2020-07-29T12:39:14.692746+00:00 app[worker.1]: result = func(*args, **kwargs)
2020-07-29T12:39:14.692746+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.7/site-packages/telegram/bot.py", line 1898, in edit_message_text
2020-07-29T12:39:14.692746+00:00 app[worker.1]: return self._message(url, data, timeout=timeout, reply_markup=reply_markup, **kwargs)
2020-07-29T12:39:14.692747+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.7/site-packages/telegram/bot.py", line 175, in _message
2020-07-29T12:39:14.692747+00:00 app[worker.1]: result = self._request.post(url, data, timeout=timeout)
2020-07-29T12:39:14.692747+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.7/site-packages/telegram/utils/request.py", line 333, in post
2020-07-29T12:39:14.692747+00:00 app[worker.1]: **urlopen_kwargs)
2020-07-29T12:39:14.692748+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.7/site-packages/telegram/utils/request.py", line 237, in _request_wrapper
2020-07-29T12:39:14.692748+00:00 app[worker.1]: message = self._parse(resp.data)
2020-07-29T12:39:14.692748+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.7/site-packages/telegram/utils/request.py", line 195, in _parse
2020-07-29T12:39:14.692756+00:00 app[worker.1]: raise RetryAfter(retry_after)
2020-07-29T12:39:14.692756+00:00 app[worker.1]: telegram.error.RetryAfter: Flood control exceeded. Retry in 9 seconds

[Feature Request] Bot should ask source and destination folder id every time we run clone

hi..
first of all thanks for the bot.

but i want to ask why we need to put folder id in the config file?
bcoz we will not copy just one folder but we will use this bot to manage our tds, lets say about 10 tds, and there are so many folders inside we want to clone, if we put folder id in config file it means we will be able to copy that folder only??

you need to make it variable, and it must ask folder id from user in telegram instead.

file error not found

2021-11-12T23:31:24.542476+00:00 heroku[worker.1]: Starting process with command python3 -m bot
2021-11-12T23:31:25.172484+00:00 heroku[worker.1]: State changed from starting to up
2021-11-12T23:31:26.003644+00:00 app[worker.1]: 2021-11-12 23:31:26,003 - bot - INFO - Bot Started!
2021-11-12T23:34:00.811086+00:00 app[worker.1]: 2021-11-12 23:34:00,810 - bot - INFO - Authorizing with 0.json service account
2021-11-12T23:34:00.812033+00:00 app[worker.1]: 2021-11-12 23:34:00,811 - telegram.utils.promise - ERROR - An uncaught error was raised while running the promise
2021-11-12T23:34:00.812034+00:00 app[worker.1]: Traceback (most recent call last):
2021-11-12T23:34:00.812035+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/telegram/utils/promise.py", line 57, in run
2021-11-12T23:34:00.812037+00:00 app[worker.1]: self._result = self.pooled_function(*self.args, **self.kwargs)
2021-11-12T23:34:00.812038+00:00 app[worker.1]: File "/app/bot/decorators.py", line 8, in wrapper
2021-11-12T23:34:00.812038+00:00 app[worker.1]: return func(*args, **kwargs)
2021-11-12T23:34:00.812039+00:00 app[worker.1]: File "/app/bot/main.py", line 54, in cloneNode
2021-11-12T23:34:00.812039+00:00 app[worker.1]: gd = GoogleDriveHelper(GFolder_ID=DESTINATION_ID)
2021-11-12T23:34:00.812039+00:00 app[worker.1]: File "/app/bot/gDrive.py", line 44, in init
2021-11-12T23:34:00.812039+00:00 app[worker.1]: self.__service = self.authorize()
2021-11-12T23:34:00.812040+00:00 app[worker.1]: File "/app/bot/gDrive.py", line 284, in authorize
2021-11-12T23:34:00.812040+00:00 app[worker.1]: credentials = service_account.Credentials.from_service_account_file(
2021-11-12T23:34:00.812041+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/google/oauth2/service_account.py", line 238, in from_service_account_file
2021-11-12T23:34:00.812041+00:00 app[worker.1]: info, signer = _service_account_info.from_filename(
2021-11-12T23:34:00.812041+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.9/site-packages/google/auth/_service_account_info.py", line 72, in from_filename
2021-11-12T23:34:00.812042+00:00 app[worker.1]: with io.open(filename, "r", encoding="utf-8") as json_file:
2021-11-12T23:34:00.812042+00:00 app[worker.1]: FileNotFoundError: [Errno 2] No such file or directory: 'accounts/0.json'

this is log in heroku i followed the video to the letter cannot get past this stage what have i done wrong

Need Some Improvements

Currently when i run clone command, it stucks after about 1.3or 1.4TB every time and i cant tell if the bot got reset or it just stuck itself. There is no any /status command which can tell cloning is running or got cancelled.

Also there should be option to select howmany operations can run simultaneously like if there are small files than we can take a much as possible otherwise very few like we do in rclone command on pc.

So here is some suggestions;

  • Add /status command which will tell what operation is running or tells that no any operation is running.
  • Should show what files its checking or skipping so that we can be assure the bot is working, otherwise it looks like it got stuck
  • Bot status which will tell how long bot is running and some more info u can gather
  • Add option to skip some folders by using their folder-id. Like i am cloning a huge folder and i know i have already cloned some sub-folders and dont want want to check their files to save some time.
  • Ability to run multiple clone operations

Youtube-dl issue

The bot was initially was giving error for not able to found youtube-dl so i changed the requirement.txt and made it to point to original youtube-dl but because of that my app get suspended.
Please update the proper youtube-dl in requirement.

Get rid of /clone

Can we get rid of /clone command? The bot doesn't do anything rather cloning then why we need to type /clone every time. That's kinda annoying.

Possible improvements.

I think you need a script to add them to google groups, when you are copying from public td you need to join the group to clone.

After following the video i still got Error on lines

๎บง python3 -m bot
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.8/runpy.py", line 144, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/home/runner/Telegram-CloneBot/bot/init.py", line 4, in
import telegram.ext as tg
ModuleNotFoundError: No module named 'telegram'
๎บง python3 -m bot
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.8/runpy.py", line 144, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details
import(pkg_name)
File "/home/runner/Telegram-CloneBot/bot/init.py", line 4, in
import telegram.ext as tg
ModuleNotFoundError: No module named 'telegram'

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.