Skip to content

Commit

Permalink
TheChampu
Browse files Browse the repository at this point in the history
  • Loading branch information
TheChampu committed Oct 26, 2024
1 parent 613ca4e commit a6230c5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 37 deletions.
16 changes: 2 additions & 14 deletions ChampuMusic/platforms/Youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from ChampuMusic.utils.formatters import time_to_seconds


def cookie_txt_file():
def cookie_text_file():
folder_path = f"{os.getcwd()}/cookies"
txt_files = glob.glob(os.path.join(folder_path, "*.txt"))
if not txt_files:
Expand Down Expand Up @@ -130,14 +130,6 @@ async def details(self, link: str, videoid: Union[bool, str] = None):
link = self.base + link
if "&" in link:
link = link.split("&")[0]

# Initialize variables
title = None
duration_min = None
duration_sec = 0
thumbnail = None
vidid = None

results = VideosSearch(link, limit=1)
for result in (await results.next())["result"]:
title = result["title"]
Expand All @@ -148,12 +140,8 @@ async def details(self, link: str, videoid: Union[bool, str] = None):
duration_sec = 0
else:
duration_sec = int(time_to_seconds(duration_min))

# Check if title was assigned
if title is None:
raise ValueError("No details found for the provided link.")

return title, duration_min, duration_sec, thumbnail, vidid

async def title(self, link: str, videoid: Union[bool, str] = None):
if videoid:
link = self.base + link
Expand Down
4 changes: 2 additions & 2 deletions ChampuMusic/plugins/tools/authtoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def check_auth_token():
try:
with YoutubeDL(opts) as ytdl:
ytdl.extract_info(
"https://www.youtube.com/watch?v=LLF3GMfNEYU", download=False
"https://www.youtube.com/watch?v=Zrvg82amofs", download=False
)
return True
except Exception as e:
Expand Down Expand Up @@ -69,7 +69,7 @@ async def check_cookies(video_url):
async def list_formats(client, message):
ok = await message.reply_text("**Checking Cookies & auth token...**")

video_url = "https://www.youtube.com/watch?v=LLF3GMfNEYU"
video_url = "https://www.youtube.com/watch?v=Zrvg82amofs"

auth_token_status = await check_auth_token()
cookie_status = await check_cookies(video_url)
Expand Down
34 changes: 13 additions & 21 deletions cookies/cookies.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
# Netscape HTTP Cookie File
"""# Netscape HTTP Cookie File
# This is a generated file! Do not edit.

# domain include_subdomains path secure expiration_date name value
.youtube.com TRUE / TRUE 1761058686 __Secure-1PSIDCC AKEyXzV9D0vnOwk25AdsQwYvqrXk94B0XLJqDbdQhbrDWQXVeC1ioEknA3rH7Z3IOXB-qFAc
.youtube.com TRUE / TRUE 1764082606 SAPISID mWeUvNNFVaBPWXDA/ARVRpI9ttO6P4JavT
.youtube.com TRUE / FALSE 1764082606 APISID LCs2WZUksOt9aCXF/A38GPtw_uIVLb77E3
.youtube.com TRUE / TRUE 1764082606 SSID AtPzPrfdQK6GbY7a2
.youtube.com TRUE / TRUE 1764082606 __Secure-3PAPISID mWeUvNNFVaBPWXDA/ARVRpI9ttO6P4JavT
.youtube.com TRUE / TRUE 1764082606 __Secure-1PSID g.a000pQimlbIUV0D28YG617GjBtnLSTTIo9NbMvOoeTO8GZBUQhURt43w2-nXh8-EvkpqvMt3rgACgYKATASARMSFQHGX2MidzicyB7tLV6Wzk3STJOImxoVAUF8yKpXaI64mQ7UQ4hScxwOxpqP0076
.youtube.com TRUE / FALSE 1761058686 SIDCC AKEyXzV2hrJmrgKp3kPyqsWmAtWQ1O_i3JEiuxr3-Yz7gCjC_xi0zg_HBjmizz0LnQ86_W_z
.youtube.com TRUE / TRUE 1764082606 __Secure-3PSID g.a000pQimlbIUV0D28YG617GjBtnLSTTIo9NbMvOoeTO8GZBUQhURamtc2XdfGgN81Sfby9DTegACgYKAQYSARMSFQHGX2MiDlOca8oaCvkELI18t8ZsCBoVAUF8yKoj4Ja5ngrHSXD14nC-5TFz0076
.youtube.com TRUE / FALSE 1764082606 HSID A1pSik2kFHLqXx7CS
.youtube.com TRUE / TRUE 1761058606 __Secure-1PSIDTS sidts-CjIBQlrA-Ik9gO9z7pjfN07YwJigudNkO2huOiXIYF7roQXf5RQ2cqDEKoTIAsSQ5IFrrBAA
.youtube.com TRUE / TRUE 1761058686 __Secure-3PSIDCC AKEyXzUoXIHCXGcAJubIkvTpa-rS8jooMBiy-r0Xuy-Wyb1cKCiVX1D8qvHl2d2hA-GW-_BM
.youtube.com TRUE / TRUE 1764082606 LOGIN_INFO AFmmF2swRQIgBx832_gHsoczXBNP76CBRnWuHdq5xo7BpjVlPegKr6QCIQDtUl21zvXbNka0KgfzED90wU98nhqCRErhSGiz8ywLjA:QUQ3MjNmeTZ0UjZlemRJZm1VeHBaVmdFZ0Q5QzFKWDVNaWczcTktY0ZPN3BMNm9wMFVhczAwdElkNDFTeVFxQ2JEUG1PdkpwWXRJaWZZVkxiTnNtbmdnRnJQNHhlQU5faEdGMC1tSnRQNnlnc3YtYlotVXNkTDAyZWhjeS1tZHc4TGZtdzJwTmRGb3FNZEluREp1WHM1Nmxhd2F5WUNZUUdB
.youtube.com TRUE / TRUE 0 YSC IoPyJ0M5ITM
.youtube.com TRUE / TRUE 1764082606 __Secure-1PAPISID mWeUvNNFVaBPWXDA/ARVRpI9ttO6P4JavT
.youtube.com TRUE / FALSE 1764082606 SID g.a000pQimlbIUV0D28YG617GjBtnLSTTIo9NbMvOoeTO8GZBUQhURiKUhV-eI128-hiqs72BbcQACgYKAS8SARMSFQHGX2MiRKO02J7T2FHaOjo1Yqg4lRoVAUF8yKrbo9ehWlv8n8UwsEUrL9eN0076
.youtube.com TRUE / TRUE 1729524383 GPS 1
.youtube.com TRUE / TRUE 1764082627 PREF f6=40000000&tz=Asia.Calcutta&f4=4000000&f7=100
.youtube.com TRUE / TRUE 1740370035 VISITOR_PRIVACY_METADATA CgJJThIEGgAgRw%3D%3D
.youtube.com TRUE / TRUE 1761058606 __Secure-3PSIDTS sidts-CjIBQlrA-Ik9gO9z7pjfN07YwJigudNkO2huOiXIYF7roQXf5RQ2cqDEKoTIAsSQ5IFrrBAA
.youtube.com TRUE / TRUE 1740370035 VISITOR_INFO1_LIVE hbMmgJydt8o
.youtube.com TRUE / TRUE 0 bdQglPTVwyA&
.youtube.co6m TRUE / LOGIN_INFO RWYzBJNGIteEhuRlgwQ0d4U1dLS2tPeUF6d0NYUDZVd1h6ZmF5cEJUQm1VOU40dkpFc3llbUJ2ajg5SU1nT0lzRjhVUzJ4MW1R
.gyoutube.com TRUE / TRUggE 1760242928 __Secure-1PSIDTS sidts-CjIBQlrA-MpUgROmrRRT1g5C-wF59AZMeYtMU3Gepk2_vS4XpYHxZ4RjY2DtMSkHDqCczxAA
.y&outube.com TRUE / TRUE 1763266928 __Secure-3PAPISID urovBJVKp7JIuEf5/Ap1Z3RR90f2H_rjU2
.youtgugbe.com TRUE / TRUE 1763267264 PREF tz=Asia.Calcutta
.youtube.com TRUE / TRUE __ AKEyXzXg_TyTnbnf-12QOv-8JrIsEH1zaDf-uGgP8Li_Ve13ZvTM2gbZ1KNO1TV3c93HTUISjA
.yout&&&ube.com TRgUE /-& TRUgE 1744258927 VISITOR_PRIVACY_METADATA CgJJThIEGgAgag%3D%3D
.youtube.com TRUE / 1763266928 __Secure-3PSID g.a0+00pAgV-RpTWcxgY_PEqIimyE_uUrbJpzhFu8jJz_chp91DQmfD9Jvt7FCUx8vRXDOxJWmS6AACgYKAYQSAQASFQHGX2Mi5echzxbjUp2AOoj3l6kgPRoVAUF8yKrvkrZuoNuyPqt9Nkn1Enga0076
.you;tube.com TRUE / TRUE 1760242928 __Secure-3PSIDTS sidts-CjIBQlrA-MpUgROmrRRT1g5C-wF59AZMeYtMU3Gepk2_vS4XpYHxZ4RjY2DtMSkHDqCczxAA
.y!outube.com TRUE / TRUE VISITOR_INFO1_LIVE wLAUnwi-XNE
.yo!utube.com TRUE / TRUE GPS 1
fgg

0 comments on commit a6230c5

Please sign in to comment.