Skip to content

Commit

Permalink
Update kemono-dl.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaSlayer1964 authored Oct 25, 2021
1 parent 8db55b6 commit a177a92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kemono-dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ def download_yt_dlp(path, link):
ydl_opts = {
"format" :"bestvideo+bestaudio",
"outtmpl" : "{}/%(title)s.%(ext)s".format(path),
"noplaylist" : True,
"noplaylist" : True, # stops from downloading an entire youtube channel
"merge_output_format" : "mp4"
}
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
ydl.download([link])
return 0
except:
print('Error with yt-dlp and link: {link}'.format(link)) # errors always ignored
print('Error with yt-dlp and link: {}'.format(link)) # errors always ignored
return 1

def check_size(size):
Expand Down Expand Up @@ -333,7 +333,7 @@ def save_post(post, info):
return

post_title = re.sub('[\\n\\t]+',' ', re.sub('[\\/:\"*?<>|]+','', post['title'] )).strip('.').strip() # removing illegal windows characters
post_folder = '[{}] [{id}] {}'.format(date_string, post_title, **post)[:248].strip() # shorten folder name length for windows
post_folder = '[{}] [{id}] {}'.format(date_string, post_title, **post)[:248].strip('.').strip() # shorten folder name length for windows
post_path = os.path.join(info['path'], post_folder)
if not os.path.exists(post_path):
os.makedirs(post_path)
Expand Down

0 comments on commit a177a92

Please sign in to comment.