diff options
-rwxr-xr-x | comedyGenerator | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/comedyGenerator b/comedyGenerator index 54924e5..410009c 100755 --- a/comedyGenerator +++ b/comedyGenerator @@ -103,8 +103,9 @@ elif args.usingJavascript: if args.amount > 0: videos = videos[:args.amount] for video in videos: - name = tags + "-" + hashlib.md5(video.encode('utf-8')).hexdigest() + ".mp4" - print("saving " + video['data-src'] + " as " + name) + URL = video.get_attribute("data-src") + name = tags + "-" + hashlib.md5(URL.encode('utf-8')).hexdigest() + ".mp4" + print("saving " + video.get_attribute("data-src") + " as " + name) for tries in range(100): try: urllib.request.urlretrieve(video.get_attribute("data-src"), '/home/' + os.environ['USER'] + '/Videos/unsorted/' + name) |