Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SpEcHiDe committed Sep 2, 2020
1 parent 21bb1a3 commit 98d7902
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 31 deletions.
20 changes: 0 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,9 @@ cd PublicLeech
python3 -m venv venv
. ./venv/bin/activate
pip install -r requirements.txt
# <Create config.py appropriately>
python3 -m tobrot
```

### an example config.py 👇
```py
from tobrot.sample_config import Config

class Config(Config):
TG_BOT_TOKEN = "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
# These example values won't work. You must get your own app_id and
# api_hash from https://my.telegram.org, under API Development.
APP_ID = 6
API_HASH = "eb06d4abfb49dc3eeb1aeb98ae0f581e"
# please read https://t.me/c/1279877202/74
# if you have not read the above README
AUTH_CHANNEL = [
-1001234567890,
7351948,
-456790
]
```

### Variable Explanations

##### Mandatory Variables
Expand Down
97 changes: 97 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"name": "Telegram Torrent Leecher",
"description": "A Telegram Torrent (and youtube-dl) Leecher based on Pyrogram. Powered by @ThankTelegram!",
"keywords": [
"telegram",
"best",
"indian",
"pyrogram",
"torrent",
"3",
"plugin",
"modular",
"productivity",
"youtube-dl",
"leecher"
],
"repository": "https://github.com/SpEcHiDe/PublicLeech",
"website": "https://github.com/SpEcHiDe/PublicLeech",
"logo": "https://telegra.ph/file/8b973b270f4f380a427b1.png",
"env": {
"ENV": {
"description": "Setting this to ANYTHING will enable webhooks when in env mode",
"value": "ANYTHING"
},
"APP_ID": {
"description": "Get this value from https://my.telegram.org",
"value": ""
},
"API_HASH": {
"description": "Get this value from https://my.telegram.org",
"value": ""
},
"TG_BOT_TOKEN": {
"description": "get this value from @BotFather",
"value": ""
},
"AUTH_CHANNEL": {
"description": "should be an integer. The BOT API ID of the Telegram Group, where the Leecher should work.",
"value": ""
},
"CHUNK_SIZE": {
"description": "should be an integer",
"value": "128",
"required": false
},
"ARIA_TWO_STARTED_PORT": {
"description": "should be an integer. The port on which aria2c daemon must start, and keep listening.",
"value": "6800",
"required": false
},
"EDIT_SLEEP_TIME_OUT": {
"description": "should be an integer. Number of seconds to wait before editing a message.",
"value": "1",
"required": false
},
"MAX_TIME_TO_WAIT_FOR_TORRENTS_TO_START": {
"description": "should be an integer. Number of seconds to wait before cancelling a torrent.",
"required": false
},
"FINISHED_PROGRESS_STR": {
"description": "should be a single character.",
"required": false
},
"UN_FINISHED_PROGRESS_STR": {
"description": "should be a single character.",
"required": false
},
"TG_OFFENSIVE_API": {
"description": "should be an URL accepting the FormParams {i}, {m}, and {t}",
"required": false
},
"R_CLONE_CONF_URI": {
"description": "should be a Telegram URL",
"required": false
},
"R_CLONE_DEST": {
"description": "destination path for rclone, must start with '/'",
"value": "/PublicLeech",
"required": false
},
"SHOULD_USE_BUTTONS": {
"description": "because, https://t.me/c/1494623325/5603",
"required": false
},
"LANG": {
"description": "Setting the encoding to UTF-8 Dont touch this",
"value": "C.UTF-8"
}
},
"stack": "container",
"formation": {
"worker": {
"quantity": 1,
"size": "free"
}
}
}
3 changes: 3 additions & 0 deletions heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build:
docker:
worker: Dockerfile
22 changes: 11 additions & 11 deletions tobrot/helper_funcs/download_aria_p_n.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ async def aria_start():

def add_magnet(aria_instance, magnetic_link, c_file_name):
options = None
if c_file_name is not None:
options = {
"dir": c_file_name
}
# if c_file_name is not None:
# options = {
# "dir": c_file_name
# }
try:
download = aria_instance.add_magnet(
magnetic_link,
Expand Down Expand Up @@ -109,10 +109,10 @@ def add_torrent(aria_instance, torrent_file_path):

def add_url(aria_instance, text_url, c_file_name):
options = None
if c_file_name is not None:
options = {
"dir": c_file_name
}
# if c_file_name is not None:
# options = {
# "dir": c_file_name
# }
uris = [text_url]
# Add URL Into Queue
try:
Expand Down Expand Up @@ -167,7 +167,7 @@ async def fake_etairporpa_call(
await asyncio.sleep(1)
file = aria_instance.get_download(err_message)
to_upload_file = file.name
#
# -_-
r_clone_conf_file = await get_r_clone_config(
R_CLONE_CONF_URI,
sent_message_to_update_tg_p._client
Expand Down Expand Up @@ -235,10 +235,10 @@ async def call_apropriate_function(
return False, "can't get metadata \n\n#stopped"
await asyncio.sleep(1)
file = aria_instance.get_download(err_message)
to_upload_file = os.path.join(
to_upload_file = file.name """os.path.join(
c_file_name,
file.name
)
)"""
if not file.is_complete:
return False, (
"unable to download, "
Expand Down

0 comments on commit 98d7902

Please sign in to comment.