Skip to content

Commit

Permalink
Merge pull request #289 from monlor/test
Browse files Browse the repository at this point in the history
feat: 🎸 支持阿里云盘转存115播放
monlor authored Dec 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 147c0d4 + ceb3ab8 commit 2ff492d
Showing 4 changed files with 25 additions and 1 deletion.
10 changes: 10 additions & 0 deletions alist/start.sh
Original file line number Diff line number Diff line change
@@ -54,6 +54,16 @@ fi
if [ -n "${PAN115_COOKIE:-}" ]; then
echo "添加115网盘 Cookie..."
echo "${PAN115_COOKIE}" > /data/115_cookie.txt
if [ "${ALIYUN_TO_115}" = "true" ]; then
cat > /data/ali2115.txt <<-EOF
purge_ali_temp=true
cookie="${PAN115_COOKIE}"
purge_pan115_temp=true
dir_id=0
EOF
else
rm -rf /data/ali2115.txt
fi
else
rm -rf /data/115_cookie.txt
fi
2 changes: 2 additions & 0 deletions env
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ ALIYUN_FOLDER_ID=
QUARK_COOKIE=
# 115网盘的cookie
PAN115_COOKIE=
# 阿里云盘转存115播放
ALIYUN_TO_115=
# 自动更新小雅alist文件
AUTO_UPDATE_ENABLED=false
# 自动清理阿里云盘
12 changes: 12 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -131,6 +131,7 @@ open_token=""
folder_id=""
quark_cookie=""
pan115_cookie=""
aliyun_to_115="false"

# 如果是更新服务,则从原有的compose配置中获取token等信息
if [ "${update}" != "0" ]; then
@@ -139,6 +140,7 @@ if [ "${update}" != "0" ]; then
folder_id=$(grep ALIYUN_FOLDER_ID "$install_path/env" 2> /dev/null | cut -d '=' -f2-)
quark_cookie=$(grep QUARK_COOKIE "$install_path/env" 2> /dev/null | cut -d '=' -f2-)
pan115_cookie=$(grep PAN115_COOKIE "$install_path/env" 2> /dev/null | cut -d '=' -f2-)
aliyun_to_115=$(grep ALIYUN_TO_115 "$install_path/env" 2> /dev/null | cut -d '=' -f2-)
fi

# 让用户输入阿里云盘TOKEN,token获取方式教程:https://alist.nn.ci/zh/guide/drivers/aliyundrive.html
@@ -181,6 +183,15 @@ echo "登陆115网盘,浏览器F12,点击network,随便点一个请求,
read -rp "请输入115网盘Cookie值(默认为$pan115_cookie): " res
pan115_cookie=${res:=$pan115_cookie}

if [ -n "${pan115_cookie}" ]; then
read -rp "是否开启将阿里云盘转存到115播放?[y/n]: " res
if [ "${res}" = "y" ]; then
aliyun_to_115="true"
else
aliyun_to_115="false"
fi
fi

# 选择部署服务类型,alist + emby (默认), alist, alist + jellyfin, alist + emby + jellyfin
echo
echo "部署类型:"
@@ -225,6 +236,7 @@ sedsh "s#ALIYUN_OPEN_TOKEN=.*#ALIYUN_OPEN_TOKEN=$open_token#g" env
sedsh "s#ALIYUN_FOLDER_ID=.*#ALIYUN_FOLDER_ID=$folder_id#g" env
sedsh "s#QUARK_COOKIE=.*#QUARK_COOKIE=$quark_cookie#g" env
sedsh "s#PAN115_COOKIE=.*#PAN115_COOKIE=$pan115_cookie#g" env
sedsh "s#ALIYUN_TO_115=.*#ALIYUN_TO_115=$aliyun_to_115#g" env

if [ -n "$IMAGE_PROXY" ]; then
sedsh -E "s#image: [^/]+#image: ${IMAGE_PROXY}#g" docker-compose.yml
2 changes: 1 addition & 1 deletion metadata/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -235,7 +235,7 @@ if [ "${EMBY_ENABLED:=false}" = "true" ]; then
# 随机生成一个时间,避免给服务器造成压力
random_min=$(shuf -i 0-59 -n 1)
random_hour=$(shuf -i 1-6 -n 1)
crontabs="${crontabs}\n${random_min} ${random_hour} * * * python3 /solid.py --media ${MEDIA_DIR}/xiaoya"
crontabs="${crontabs}\n${random_min} ${random_hour} * * * /usr/local/bin/python3 /solid.py --media ${MEDIA_DIR}/xiaoya"
fi
fi

0 comments on commit 2ff492d

Please sign in to comment.