ytdlbot/pre-push.py
Benny d472cdc03c
WIP: refactor (#460)
* step1

* remove

* add pdm

* going

* going

* going

* Improved `extract_code_from_instagram_url` function

* Remove terabox download function

Due to server-side restrictions, the Terabox download function is currently does not work as intended.

* Remove unused `parse_cookie_file` function

This commit removes the `parse_cookie_file` function as it is no longer required following the removal of the Terabox download function.

* define abstract class

* basic upload done?

* db operation

* db operation

* db operation

* db operation

* db operation

* fix name_pattern regex of `extract_url_and_name` function

* pre-commit

* pre-push

* pre-push

* Refactor: Change single quotes to double quotes for name_pattern regex

* add more methods

* rename

* use self._bot_msg

* download done?

* update deps

* add entrance

* runnable

* fixes

* fix

* record usage fix

* add cookies

* fix settings

* hint

* hint

* reset

* rename

* formats fix

* update README.md

* update

* rename

* rename

---------

Co-authored-by: Sanuja Seneviratne <66342986+SanujaNS@users.noreply.github.com>
2025-01-14 19:32:19 +01:00

22 lines
512 B
Python
Executable file

#!/usr/bin/env python3
# coding: utf-8
# ytdlbot - pre-commit.py
# for dependabot
import tomllib
import subprocess
with open("pyproject.toml", "rb") as file:
config = tomllib.load(file)
with open("requirements.txt", "w") as file:
for item in config["project"]["dependencies"]:
if " " in item:
item = item.split()[-1]
file.write(f"{item}\n")
# commit with amend
subprocess.run(["git", "add", "requirements.txt"])
subprocess.run(["git", "commit", "--amend", "--no-edit"])