Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
5hojib committed Jul 10, 2024
1 parent 707d03e commit 1817d09
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 4 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Ruff

on:
push:
branches: [dev]

jobs:
ruff:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GX_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'

- name: Install ruff
run: |
pip install ruff
- name: Run ruff and format code
run: |
ruff check . --fix --exit-zero
git add -u
git status
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "Auto-format code using ruff"
git push origin ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GX_TOKEN }}
3 changes: 1 addition & 2 deletions bot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
from .helper.telegram_helper.filters import CustomFilters
from .helper.telegram_helper.button_build import ButtonMaker
from .helper.listeners.aria2_listener import start_aria2_listener
from .modules import authorize, cancel_mirror, mirror_leech, status, torrent_search, ytdlp, shell, executor, users_settings, torrent_select, bot_settings, speedtest, images, mediainfo, broadcast
from .helper.mirror_leech_utils.gdrive_utils import count, delete, list, clone
from .modules import authorize, cancel_mirror, mirror_leech, status, torrent_search, ytdlp, shell, executor, users_settings, torrent_select, bot_settings, speedtest, images, mediainfo, broadcast, count, delete, list, clone # noqa: F401


if config_dict['GDRIVE_ID']:
Expand Down
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions bot/modules/torrent_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pyrogram.filters import command, regex
from aiofiles.os import remove as aioremove, path as aiopath

from bot import bot, aria2, download_dict, download_dict_lock, OWNER_ID, user_data, LOGGER
from bot import bot, aria2, download_dict, download_dict_lock, OWNER_ID, user_data, LOGGER, xnox_client
from bot.helper.telegram_helper.filters import CustomFilters
from bot.helper.telegram_helper.message_utils import sendMessage, sendStatusMessage
from bot.helper.ext_utils.bot_utils import getDownloadByGid, MirrorStatus, bt_selection_buttons, sync_to_async
Expand Down Expand Up @@ -30,7 +30,7 @@ async def get_confirm(client, query):
await query.answer()
id_ = data[3]
if len(id_) > 20:
client = dl.client()
client = xnox_client
tor_info = (await sync_to_async(client.torrents_info, torrent_hash=id_))[0]
path = tor_info.content_path.rsplit('/', 1)[0]
res = await sync_to_async(client.torrents_files, torrent_hash=id_)
Expand Down

0 comments on commit 1817d09

Please sign in to comment.