Add Timezon config

Signed-off-by: breakdowns <hafitz666@outlook.co.id>
This commit is contained in:
Hafitz Setya 2021-07-19 04:10:48 +07:00 committed by GitHub
parent c884bda61c
commit 45eec691d1
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 6 deletions

View File

@ -49,7 +49,7 @@ tgx, yts, eztv, torlock, rarbg
letsupload.io, hxfile.co, anonfiles.com, bayfiles.com, antfiles,
fembed.com, fembed.net, femax20.com, layarkacaxxi.icu, fcdn.stream,
sbplay.org, naniplay.com, naniplay.nanime.in, naniplay.nanime.biz, sbembed.com,
streamtape.com, streamsb.net, feurl.com, pixeldrain.com,
streamtape.com, streamsb.net, feurl.com, pixeldrain.com, racaty.net,
1drv.ms (Only works for file not folder or business account),
uptobox.com (Uptobox account must be premium)
```
@ -167,6 +167,7 @@ Fill up rest of the fields. Meaning of each fields are discussed below:
- **MEGA_LIMIT**: To limit downloading Mega (leave space between number and unit, Available units is (gb or GB, tb or TB), Examples: ```100 gb, 100 GB, 10 tb, 10 TB```
- **TORRENT_DIRECT_LIMIT**: To limit the Torrent/Direct mirror size, Leave space between number and unit. Available units is (gb or GB, tb or TB), Examples: ```100 gb, 100 GB, 10 tb, 10 TB```
- **TAR_UNZIP_LIMIT**: To limit mirroring as Tar or unzipmirror. Available units is (gb or GB, tb or TB), Examples: ```100 gb, 100 GB, 10 tb, 10 TB```
- **TIMEZONE**: To change time zone in ```/stats``` command (**NOTE**: Default time zone using ```Asia/Jakarta```)
- **IMAGE_URL**: Show Image/Logo in /start message. Fill value of image your link image, use telegra.ph or any direct link image.
- **VIEW_LINK**: View Link button to open file Index Link in browser instead of direct download link, you can figure out if it's compatible with your Index code or not, open any video from you Index and check if the END of link from browser link bar is `?a=view`, if yes make it `True` it will work (Compatible with [Bhadoo Index](https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index) Code)
- **UPTOBOX_TOKEN**: Uptobox token to mirror uptobox links. Get it from [Uptobox Premium Account](https://uptobox.com/my_account).

View File

@ -152,6 +152,11 @@
"description": "Fill your shortener api key if you are using shortener.",
"required": false
},
"TIMEZONE": {
"description": "To change time zone in /stats command.",
"value": "Asia/Jakarta",
"required": false
},
"IMAGE_URL": {
"description": "Show Image/Logo in /start message, Use telegra.ph or any direct link image.",
"value": "https://telegra.ph/file/db03910496f06094f1f7a.jpg",

View File

@ -348,6 +348,13 @@ try:
UNFINISHED_PROGRESS_STR = '○'
except KeyError:
UNFINISHED_PROGRESS_STR = '○'
try:
TIMEZONE = getConfig('TIMEZONE')
if len(TIMEZONE) == 0:
TIMEZONE = 'Asia/Jakarta'
except KeyError:
TIMEZONE = 'Asia/Jakarta'
updater = tg.Updater(token=BOT_TOKEN)
bot = updater.bot
dispatcher = updater.dispatcher

View File

@ -11,7 +11,7 @@ import time
from telegram import ParseMode
from telegram.ext import CommandHandler
from bot import bot, dispatcher, updater, botStartTime, IMAGE_URL, IGNORE_PENDING_REQUESTS
from bot import bot, dispatcher, updater, botStartTime, IMAGE_URL, IGNORE_PENDING_REQUESTS, TIMEZONE
from bot.helper.ext_utils import fs_utils
from bot.helper.telegram_helper.bot_commands import BotCommands
from bot.helper.telegram_helper.message_utils import *
@ -19,8 +19,7 @@ from .helper.ext_utils.bot_utils import get_readable_file_size, get_readable_tim
from .helper.telegram_helper.filters import CustomFilters
from bot.helper.telegram_helper import button_build
from .modules import authorize, list, cancel_mirror, mirror_status, mirror, clone, watch, shell, eval, torrent_search, delete, speedtest, usage, mediainfo, count, config, updates
now=datetime.now(pytz.timezone('Asia/Jakarta'))
now=datetime.now(pytz.timezone(f'{TIMEZONE}'))
def stats(update, context):

View File

@ -192,7 +192,7 @@ async def config_button(_, query):
elif data == '9':
return await query.message.edit(
__header__.format(data)
+ f"**[ Others Config ]**\n\n**VIEW_LINK:** `{VIEW_LINK}`\n\n**STATUS_LIMIT:** `{STATUS_LIMIT}`\n\n**DOWNLOAD_STATUS_UPDATE_INTERVAL:** `{DOWNLOAD_STATUS_UPDATE_INTERVAL}`\n\n**IGNORE_PENDING_REQUESTS:** `{IGNORE_PENDING_REQUESTS}`\n\n**AUTO_DELETE_MESSAGE_DURATION:** `{AUTO_DELETE_MESSAGE_DURATION}`\n\n**DOWNLOAD_DIR:** `{DOWNLOAD_DIR}`\n\n**IMAGE_URL:** `{IMAGE_URL}`\n\n**DATABASE_URL:** `{DB_URI}`",
+ f"**[ Others Config ]**\n\n**VIEW_LINK:** `{VIEW_LINK}`\n\n**STATUS_LIMIT:** `{STATUS_LIMIT}`\n\n**TIMEZONE:** `{TIMEZONE}`\n\n**DOWNLOAD_STATUS_UPDATE_INTERVAL:** `{DOWNLOAD_STATUS_UPDATE_INTERVAL}`\n\n**IGNORE_PENDING_REQUESTS:** `{IGNORE_PENDING_REQUESTS}`\n\n**AUTO_DELETE_MESSAGE_DURATION:** `{AUTO_DELETE_MESSAGE_DURATION}`\n\n**DOWNLOAD_DIR:** `{DOWNLOAD_DIR}`\n\n**IMAGE_URL:** `{IMAGE_URL}`\n\n**DATABASE_URL:** `{DB_URI}`",
reply_markup=types.InlineKeyboardMarkup(
[
[

View File

@ -32,6 +32,7 @@ STOP_DUPLICATE_CLONE = ""
STOP_DUPLICATE_MEGA = ""
SHORTENER = ""
SHORTENER_API = ""
TIMEZONE = "Asia/Jakarta"
IMAGE_URL = "https://telegra.ph/file/db03910496f06094f1f7a.jpg"
# If you want to use Credentials externally from Index Links, fill these vars with the direct links
# These are optional, if you don't know, simply leave them, don't fill anything in them.

View File

@ -2,7 +2,7 @@ aiohttp
aria2p
appdirs
beautifulsoup4
cloudscrape==0.4.2
cloudscrape
feedparser
gitpython
google-api-python-client