CoolnsX / dra-cla

A cli tool to browse and play korean drama, chinese drama
GNU General Public License v3.0
71 stars 10 forks source link

fixing video url not found #3

Closed farisamirmudin closed 1 year ago

CoolnsX commented 1 year ago

@farisamirmudin already fixed in latest commit

diff --git a/dra-cla b/dra-cla
index ab28613..fe4096e 100755
--- a/dra-cla
+++ b/dra-cla
@@ -1,6 +1,6 @@
 #!/bin/sh

-VERSION="2.1.0"
+VERSION="2.1.1"

 #######################
 # AUXILIARY FUNCTIONS #
@@ -140,7 +140,7 @@ decrypt_link() {
    secret_key='3933343232313932343333393532343839373532333432393038353835373532'
    iv='39323632383539323332343335383235'
    ajax_url="$base_url/encrypt-ajax.php"
-   ajax=$(printf "%s" "$1" | sed -nE 's/.*id=(.*)&title.*/\1/p' | openssl enc -e -aes256 -K "$secret_key" -iv "$iv" | base64)
+   ajax=$(printf "%s" "$1" | sed -nE 's/.*id=([^&]*)&.*/\1/p' | openssl enc -e -aes256 -K "$secret_key" -iv "$iv" | base64)
    data=$(curl -s -H "X-Requested-With:XMLHttpRequest" "$ajax_url" -d "id=$ajax" | sed -e 's/{"data":"//' -e 's/"}/\n/' -e 's/\\//g')
    printf '%s' "$data" | base64 -d | openssl enc -d -aes256 -K "$secret_key" -iv "$iv" | sed -e 's/\].*/\]/' -e 's/\\//g' | tr '{|}' '\n' | sed -nE 's/\"file\":"([^"]*)".*label.*P.*/\1/p'
 }
farisamirmudin commented 1 year ago

yeah the same approach as mine, subscripting the URL until the first & sign instead of until title=

CoolnsX commented 1 year ago

Yup and I respect the changes u made but unfortunately it won't be merged now..

farisamirmudin commented 1 year ago

No problem