Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
nichind committed Nov 11, 2024
1 parent 9415b6b commit 379a54d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
20 changes: 17 additions & 3 deletions pybalt/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,27 @@ async def _():
required=False,
)
parser.add_argument(
"-filenameStyle", "-fs", type=str, help="Filename style", required=False
"-filenameStyle",
"-fs",
type=str,
help="Filename style",
required=False,
options=["classic", "pretty", "basic", "nerdy"],
)
parser.add_argument(
"-audioFormat", "-af", type=str, help="Audio format", required=False
"-audioFormat",
"-af",
type=str,
help="Audio format",
required=False,
options=["mp3", "ogg", "wav", "opus"],
)
parser.add_argument(
"-youtubeVideoCodec", "-yvc", help="Youtube video codec", required=False
"-youtubeVideoCodec",
"-yvc",
help="Youtube video codec",
required=False,
options=["vp9", "h264"],
)
parser.add_argument(
"-show",
Expand Down
22 changes: 10 additions & 12 deletions pybalt/cobalt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from dotenv import load_dotenv
from re import findall
from importlib.metadata import version
from aiocfscrape import CloudflareScraper


async def check_updates() -> bool:
Expand Down Expand Up @@ -181,17 +180,16 @@ async def get_instance(self):
key=lambda instance: instance["score"], reverse=True
)
try:
async with CloudflareScraper() as session:
async with session.get(
good_instances[0]["protocol"]
+ "://"
+ good_instances[0]["api"]
) as resp:
json = await resp.json()
if json["cobalt"]["url"] in self.skipped_instances:
raise exceptions.BadInstance()
self.api_instance = json["cobalt"]["url"]
break
async with cs.get(
good_instances[0]["protocol"]
+ "://"
+ good_instances[0]["api"]
) as resp:
json = await resp.json()
if json["cobalt"]["url"] in self.skipped_instances:
raise exceptions.BadInstance()
self.api_instance = json["cobalt"]["url"]
break
except Exception as exc:
good_instances.pop(0)
return self.api_instance
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ def readme():

setup(
name="pybalt",
version="2024.11.11",
version="2024.11.12",
author="nichind",
author_email="[email protected]",
description="",
description="Download mediafiles from YouTube, Twitter (X), Instagram, Reddit & more. CLI wrapper and python module for @imputnet's cobalt processing instance api.",
long_description=readme(),
long_description_content_type="text/markdown",
url="https://github.com/nichind/pybalt",
Expand Down

0 comments on commit 379a54d

Please sign in to comment.