summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormsglm <msglm@techchud.xyz>2023-01-11 20:51:07 -0600
committermsglm <msglm@techchud.xyz>2023-01-11 20:51:07 -0600
commit7934be390c2213c7f3be022ad3ffd21f62ad4bdd (patch)
tree88072ea7ae21280c19065b1e54f0bb3a35787414
parent6e82297298f08d332c8ce267533c8a30f8efc66b (diff)
downloadcomedyGenerator-7934be390c2213c7f3be022ad3ffd21f62ad4bdd.tar.gz
comedyGenerator-7934be390c2213c7f3be022ad3ffd21f62ad4bdd.tar.bz2
comedyGenerator-7934be390c2213c7f3be022ad3ffd21f62ad4bdd.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)