added mirror provider,updated the website link to latest, bumped version to 2.2.0

This commit is contained in:
CoolnsX
2022-09-29 22:18:05 +05:30
parent 161d87b0a4
commit 3cfa0c7836

30
dra-cla
View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
VERSION="2.1.1" VERSION="2.2.0"
####################### #######################
# AUXILIARY FUNCTIONS # # AUXILIARY FUNCTIONS #
@@ -90,16 +90,12 @@ esac
# gets drama names along with its id for search term # gets drama names along with its id for search term
search_drama () { search_drama () {
search=$(printf '%s' "$1" | tr ' ' '-' ) search=$(printf '%s' "$1" | tr ' ' '-' )
curl -s "$base_url/search.html" -G -d "keyword=$search" | curl -s "$base_url/search.html?keyword=$search" |
sed -nE 's_^[[:space:]]*<a href="/videos/([^"]*)">_\1_p' sed -nE 's_^[[:space:]]*<a href="/videos/([^"]*)">_\1_p'
} }
check_episode () { check_episode () {
data=$(curl -s "$base_url/videos/$1") curl -s "$base_url/videos/$1" | sed '/Latest Episodes/,$d' | sed -nE "s_^[[:space:]]*<a href.*videos/${2}(.*)\">_\1_p"
if [ "$data" != "404" ]; then
del=$(printf "%s" "$data" | grep -n "Latest Episodes" | cut -d ":" -f1)
printf "%s" "$data" | sed "$del,$ d" | sed -nE "s_^[[:space:]]*<a href.*videos/${2}(.*)\">_\1_p"
fi
} }
process_hist_entry () { process_hist_entry () {
@@ -137,31 +133,33 @@ get_dpage_link() {
} }
decrypt_link() { decrypt_link() {
fembed_id=$(curl -A "uwu" -s "$1" | sed -nE 's_.*fembed.*/v/([^#]*).*_\1_p')
[ -z "$fembed_id" ] || video_links=$(curl -A "uwu" -s -X POST "https://fembed9hd.com/api/source/$fembed_id" -H "x-requested-with:XMLHttpRequest" | sed -e 's/\\//g' -e 's/.*data"://' | tr "}" "\n" | sed -nE 's/.*file":"(.*)","label":"([^"]*)".*/\2>\1/p')
[ -z "$video_links" ] || return 0
secret_key='3933343232313932343333393532343839373532333432393038353835373532' secret_key='3933343232313932343333393532343839373532333432393038353835373532'
iv='39323632383539323332343335383235' iv='39323632383539323332343335383235'
ajax_url="$base_url/encrypt-ajax.php" ajax_url="$base_url/encrypt-ajax.php"
ajax=$(printf "%s" "$1" | sed -nE 's/.*id=([^&]*)&.*/\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" -a)
data=$(curl -s -H "X-Requested-With:XMLHttpRequest" "$ajax_url" -d "id=$ajax" | sed -e 's/{"data":"//' -e 's/"}/\n/' -e 's/\\//g') video_links=$(curl -s -H "X-Requested-With:XMLHttpRequest" "$ajax_url" -d "id=$ajax" | sed -e 's/{"data":"//' -e 's/"}/\n/' -e 's/\\//g' | 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')
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'
} }
# chooses the link for the set quality # chooses the link for the set quality
get_video_quality() { get_video_quality() {
dpage_url="$1" dpage_url="$1"
video_links=$(decrypt_link "$dpage_url") decrypt_link "$dpage_url"
case $quality in case $quality in
best) best)
video_link=$(printf '%s' "$video_links" | head -n 4 | tail -n 1) video_link=$(printf '%s' "$video_links" | head -n 4 | tail -n 1 | cut -d'>' -f2)
;; ;;
worst) worst)
video_link=$(printf '%s' "$video_links" | head -n 1) video_link=$(printf '%s' "$video_links" | head -n 1 | cut -d'>' -f2)
;; ;;
*) *)
video_link=$(printf '%s' "$video_links" | grep -i "${quality}p" | head -n 1) video_link=$(printf '%s' "$video_links" | grep -i "${quality}p" | head -n 1 | cut -d'>' -f2)
if [ -z "$video_link" ]; then if [ -z "$video_link" ]; then
err "Current video quality is not available (defaulting to best quality)" err "Current video quality is not available (defaulting to best quality)"
quality=best quality=best
video_link=$(printf '%s' "$video_links" | head -n 4 | tail -n 1) video_link=$(printf '%s' "$video_links" | head -n 4 | tail -n 1 | cut -d'>' -f2)
fi fi
;; ;;
esac esac
@@ -462,7 +460,7 @@ else
dep_ch "aria2c" "ffmpeg" dep_ch "aria2c" "ffmpeg"
fi fi
base_url="https://asianembed.io" base_url="https://asianplay.net"
case $scrape in case $scrape in
query) query)
if [ -z "$*" ]; then if [ -z "$*" ]; then