Skip to content

Commit

Permalink
Update utube.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerpq authored Oct 31, 2023
1 parent bb4c047 commit 81b4429
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions repthon/helpers/function/utube.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
YOUTUBE_REGEX = re.compile(
r"(?:youtube\.com|youtu\.be)/(?:[\w-]+\?v=|embed/|v/|shorts/)?([\w-]{11})"
)
PATH = "./zthon/cache/ytsearch.json"
PATH = "./repthon/cache/ytsearch.json"

song_dl = "youtube-dl --force-ipv4 --write-thumbnail --add-metadata --embed-thumbnail -o './temp/%(title)s.%(ext)s' --extract-audio --audio-format mp3 --audio-quality {QUALITY} {video_link}"
thumb_dl = "youtube-dl --force-ipv4 -o './temp/%(title)s.%(ext)s' --write-thumbnail --skip-download {video_link}"
Expand All @@ -33,9 +33,9 @@

async def yt_search(zed):
try:
zed = urllib.parse.quote(zed)
rep = urllib.parse.quote(rep)
html = urllib.request.urlopen(
f"https://www.youtube.com/results?search_query={zed}"
f"https://www.youtube.com/results?search_query={rep}"
)

user_data = re.findall(r"watch\?v=(\S{11})", html.read().decode())
Expand Down Expand Up @@ -87,7 +87,7 @@ def save(self):

ytsearch_data = YT_Search_X()

async def yt_data(zed):
async def yt_data(rep):
params = {"format": "json", "url": zed}
url = "https://www.youtube.com/oembed" # https://stackoverflow.com/questions/29069444/returning-the-urls-as-a-list-from-a-youtube-search-query
query_string = urllib.parse.urlencode(params)
Expand Down

0 comments on commit 81b4429

Please sign in to comment.