mirror of
https://github.com/CoolnsX/dra-cla.git
synced 2025-12-20 07:15:25 +05:30
fix: dynamic drama_id
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
<a href="https://discord.gg/A4c5UWNk"><img src="https://invidget.switchblade.xyz/A4c5UWNk"></a>
|
<a href="https://discord.gg/A4c5UWNk"><img src="https://invidget.switchblade.xyz/A4c5UWNk"></a>
|
||||||
<br>
|
<br>
|
||||||
<a href="https://github.com/CoolnsX"><img src="https://img.shields.io/badge/maintainer-CoolnsX-blue"></a>
|
<a href="https://github.com/CoolnsX"><img src="https://img.shields.io/badge/maintainer-CoolnsX-blue"></a>
|
||||||
|
<a href="https://github.com/iamchokerman"><img src="https://img.shields.io/badge/maintainer-iamchokerman-blue"></a>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
19
dra-cla
19
dra-cla
@@ -18,7 +18,7 @@
|
|||||||
# Project repository: https://github.com/CoolnsX/dra-cla
|
# Project repository: https://github.com/CoolnsX/dra-cla
|
||||||
|
|
||||||
# Version number
|
# Version number
|
||||||
VERSION="1.0.1"
|
VERSION="1.1.0"
|
||||||
|
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
@@ -106,18 +106,13 @@ search_drama () {
|
|||||||
sed -n -E 's_^[[:space:]]*<a href="/drama-detail/([^"]*)".*_\1_p'
|
sed -n -E 's_^[[:space:]]*<a href="/drama-detail/([^"]*)".*_\1_p'
|
||||||
}
|
}
|
||||||
|
|
||||||
search_eps () {
|
|
||||||
# get available episodes for drama_id
|
|
||||||
drama_id="$1"
|
|
||||||
curl -s "$base_url/drama-detail/$drama_id" |
|
|
||||||
sed -nE "s/.*$id.*episode-(.*).html.*/\1/p" | head -1
|
|
||||||
}
|
|
||||||
|
|
||||||
search_for_unwatched () {
|
search_for_unwatched () {
|
||||||
# compares history with dramacool, only shows unfinished drama
|
# compares history with dramacool, only shows unfinished drama
|
||||||
search_results="$*"
|
search_results="$*"
|
||||||
while read -r drama_id; do
|
while read -r drama_id; do
|
||||||
current_ep_number=$(search_eps "$drama_id")
|
temp=$(curl -s "$base_url/drama-detail/$drama_id")
|
||||||
|
current_ep_number=$(printf "%s" "$temp" | sed -nE "s/.*href.*episode-(.*).html.*class.*img.*/\1/p" | head -1)
|
||||||
|
drama_id=$(printf "%s" "$temp" | sed -nE "s/.*href=\"\/(.*)-episode-${current_ep_number}.html.*class.*img.*/\1/p" | head -1)
|
||||||
history_ep_number=$(sed -n -E "s/${drama_id}\t//p" "$logfile")
|
history_ep_number=$(sed -n -E "s/${drama_id}\t//p" "$logfile")
|
||||||
[ "$current_ep_number" -ge "$history_ep_number" ] && printf '%s\n' "$drama_id"
|
[ "$current_ep_number" -ge "$history_ep_number" ] && printf '%s\n' "$drama_id"
|
||||||
done <<-EOF
|
done <<-EOF
|
||||||
@@ -298,7 +293,9 @@ drama_selection () {
|
|||||||
done <<-EOF
|
done <<-EOF
|
||||||
$search_results
|
$search_results
|
||||||
EOF
|
EOF
|
||||||
search_ep_result=$(search_eps "$selection_id")
|
temp=$(curl -s "$base_url/drama-detail/$selection_id")
|
||||||
|
search_ep_result=$(printf "%s" "$temp" | sed -nE "s/.*href.*episode-(.*).html.*class.*img.*/\1/p" | head -1)
|
||||||
|
selection_id=$(printf "%s" "$temp" | sed -nE "s/.*href=\"\/(.*)-episode-${search_ep_result}.html.*class.*img.*/\1/p" | head -1)
|
||||||
read -r last_ep_number <<-EOF
|
read -r last_ep_number <<-EOF
|
||||||
$search_ep_result
|
$search_ep_result
|
||||||
EOF
|
EOF
|
||||||
@@ -395,7 +392,9 @@ open_episode () {
|
|||||||
inf "Getting data for episode $episode"
|
inf "Getting data for episode $episode"
|
||||||
# decrypting url
|
# decrypting url
|
||||||
dpage_link=$(get_dpage_link "$drama_id" "$episode")
|
dpage_link=$(get_dpage_link "$drama_id" "$episode")
|
||||||
|
printf "%s" "$dpage_link"
|
||||||
video_url=$(get_video_quality "$dpage_link")
|
video_url=$(get_video_quality "$dpage_link")
|
||||||
|
printf "%s" "$video_url"
|
||||||
if [ "$half_ep" -eq 1 ]; then
|
if [ "$half_ep" -eq 1 ]; then
|
||||||
episode="$temp_ep"
|
episode="$temp_ep"
|
||||||
half_ep=0
|
half_ep=0
|
||||||
|
|||||||
Reference in New Issue
Block a user