mirror of
https://github.com/cooperhammond/irs.git
synced 2024-09-18 22:35:10 +00:00
Upload to pypi
This commit is contained in:
parent
ec4258c8d8
commit
0b03127786
|
@ -127,13 +127,12 @@ class Ripper:
|
||||||
if not os.path.exists(new_loc):
|
if not os.path.exists(new_loc):
|
||||||
os.makedirs(new_loc)
|
os.makedirs(new_loc)
|
||||||
loc = loc.replace("//", "/")
|
loc = loc.replace("//", "/")
|
||||||
new_loc = (new_loc + "/" + file_name)\
|
new_loc = (new_loc + "/" + file_name).replace("//", "/")
|
||||||
.replace("//", "/")
|
|
||||||
shutil.move(loc, new_loc)
|
shutil.move(loc, new_loc)
|
||||||
|
|
||||||
return locations
|
return locations
|
||||||
|
|
||||||
def find_yt_url(self, song=None, artist=None, additional_search=None, caught_by_google=False, first=False):
|
def find_yt_url(self, song=None, artist=None, additional_search=None, caught_by_google=False, first=False, tries=0):
|
||||||
if additional_search is None:
|
if additional_search is None:
|
||||||
additional_search = Config.parse_search_terms(self)
|
additional_search = Config.parse_search_terms(self)
|
||||||
print(str(self.args["hook-text"].get("youtube")))
|
print(str(self.args["hook-text"].get("youtube")))
|
||||||
|
@ -219,7 +218,7 @@ album row at @ session".split(" ")
|
||||||
|
|
||||||
if self.code is None and first is not True:
|
if self.code is None and first is not True:
|
||||||
if additional_search == "lyrics":
|
if additional_search == "lyrics":
|
||||||
return self.find_yt_url(song, artist, additional_search, caught_by_google, first)
|
return self.find_yt_url(song, artist, additional_search, caught_by_google, first, tries=tries + 1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return ("https://youtube.com" + self.code["href"], self.code["title"])
|
return ("https://youtube.com" + self.code["href"], self.code["title"])
|
||||||
|
@ -227,10 +226,10 @@ album row at @ session".split(" ")
|
||||||
if caught_by_google is not True:
|
if caught_by_google is not True:
|
||||||
# Assuming Google catches you trying to search youtube for music ;)
|
# Assuming Google catches you trying to search youtube for music ;)
|
||||||
print("Trying to bypass google captcha.")
|
print("Trying to bypass google captcha.")
|
||||||
return self.find_yt_url(song=song, artist=artist, additional_search=additional_search, caught_by_google=True)
|
return self.find_yt_url(song=song, artist=artist, additional_search=additional_search, caught_by_google=True, tries=tries + 1)
|
||||||
elif caught_by_google is True and first is not True:
|
elif caught_by_google is True and first is not True:
|
||||||
return self.find_yt_url(song, artist, additional_search, caught_by_google, first=True)
|
return self.find_yt_url(song, artist, additional_search, caught_by_google, first=True, tries=tries + 1)
|
||||||
|
|
||||||
def album(self, title, artist=None): # Alias for spotify_list("album", ..)
|
def album(self, title, artist=None): # Alias for spotify_list("album", ..)
|
||||||
return self.spotify_list("album", title=title, artist=artist)
|
return self.spotify_list("album", title=title, artist=artist)
|
||||||
|
|
||||||
|
@ -442,11 +441,9 @@ init, or in method arguments.")
|
||||||
'progress_hooks': [YdlUtils.my_hook],
|
'progress_hooks': [YdlUtils.my_hook],
|
||||||
'output': "tmp_file",
|
'output': "tmp_file",
|
||||||
'prefer-ffmpeg': True,
|
'prefer-ffmpeg': True,
|
||||||
|
'ffmpeg_location': os.path.expanduser("~/.irs/bin/"),
|
||||||
}
|
}
|
||||||
|
|
||||||
if Config.check_ffmpeg() is False:
|
|
||||||
ydl_opts.update({'ffmpeg_location': os.path.expanduser("~/.irs/bin/")})
|
|
||||||
|
|
||||||
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
||||||
ydl.download([video_url])
|
ydl.download([video_url])
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -2,7 +2,7 @@ from setuptools import setup
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = 'irs',
|
name = 'irs',
|
||||||
version = '6.6.3',
|
version = '6.7.3',
|
||||||
description = 'A music downloader that just gets metadata.',
|
description = 'A music downloader that just gets metadata.',
|
||||||
url = 'https://github.com/kepoorhampond/irs',
|
url = 'https://github.com/kepoorhampond/irs',
|
||||||
author = 'Kepoor Hampond',
|
author = 'Kepoor Hampond',
|
||||||
|
|
Loading…
Reference in a new issue