summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormsglm <msglm@techchud.xyz>2025-08-17 19:53:50 -0500
committermsglm <msglm@techchud.xyz>2025-08-17 19:53:50 -0500
commitffead723742bf490923efcca49d4bf1e4b76a014 (patch)
tree88072ea7ae21280c19065b1e54f0bb3a35787414
parent97be309a15cac337737ed74300c6325429db97d6 (diff)
downloadcomedyGenerator-ffead723742bf490923efcca49d4bf1e4b76a014.tar.gz
comedyGenerator-ffead723742bf490923efcca49d4bf1e4b76a014.tar.bz2
comedyGenerator-ffead723742bf490923efcca49d4bf1e4b76a014.zip
fixed JS name recognition
-rwxr-xr-xcomedyGenerator5
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)