Skip to content

Commit

Permalink
Merge pull request #141 from monlor/test
Browse files Browse the repository at this point in the history
feat: 🎸 适配小雅夸克网盘
  • Loading branch information
monlor authored Jun 20, 2024
2 parents 460e658 + cfbfea0 commit 59e6556
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
4 changes: 4 additions & 0 deletions alist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ docker run -d -p 5678:80 -p 2345:2345 -p 2346:2346 --restart=unless-stopped --na

`ALIYUN_FOLDER_ID`: 进入阿里云盘网页版,资源盘里面创建一个文件夹,点击文件夹,复制浏览器阿里云盘地址末尾的文件夹ID(最后一个斜杠/后面的一串字符串)

`QUARK_COOKIE`: 夸克的cookie,登陆夸克网盘,F12找一个请求,查看请求中的Cookie信息

`PIKPAK_USER`: pikpak 账号,用来观看小雅中pikpak分享给你的资源,格式:`[email protected]:aaadds`

`PIKPAK_LIST`: 挂载你自己 pikpak 账号,格式:`挂载名:[email protected]:aaadds,aaa:+8613111111111:dasf`,密码中不支持符号,:
Expand All @@ -30,6 +32,8 @@ docker run -d -p 5678:80 -p 2345:2345 -p 2346:2346 --restart=unless-stopped --na

`ALI_SHARE_LIST`: 挂载额外的阿里云盘分享内容,格式:`挂载名1:分享ID1:文件夹ID1,挂载名2:分享ID2:文件夹ID2`

`QUARK_SHARE_LIST`: 挂载额外的夸克网盘分享内容,格式:`挂载名1:分享ID1:文件夹ID1(不存在填root):提取码1(没有留空),挂载名2:分享ID2:文件夹ID2(不存在填root):提取码2`

`TVBOX_SECURITY`: 开启tvbox随机订阅地址,true/false,默认:false

`PROXY`: 使用代理,支持http、https、socks5协议,格式:http://ip:7890 或 socks5://ip:7890
Expand Down
23 changes: 23 additions & 0 deletions alist/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ else
echo "${ALIYUN_FOLDER_ID}" > /data/temp_transfer_folder_id.txt
fi

# 设置夸克网盘cookie
if [ -n "${QUARK_COOKIE:-}" ]; then
echo "添加夸克网盘 Cookie..."
echo "${QUARK_COOKIE}" > /data/quark_cookie.txt
else
rm -rf /data/quark_cookie.txt
fi

# 设置pikpak用户密码观看pikpak资源
if [ -n "${PIKPAK_USER:-}" ]; then
echo "设置PIKPAK用户密码..."
Expand Down Expand Up @@ -95,6 +103,21 @@ else
rm -rf /data/alishare_list.txt
fi

# 挂载额外的夸克网盘分享
if [ -n "${QUARK_SHARE_LIST:-}" ]; then
echo "挂载额外的夸克网盘分享..."
rm -rf /data/quarkshare_list.txt
echo "${QUARK_SHARE_LIST}" | tr ',' '\n' | while read -r line; do
name=$(echo "$line" | cut -d':' -f1)
share_id=$(echo "$line" | cut -d':' -f2)
folder_id=$(echo "$line" | cut -d':' -f3)
code=$(echo "$line" | cut -d':' -f4)
echo "${name} ${share_id} ${folder_id} ${code}" >> /data/quarkshare_list.txt
done
else
rm -rf /data/quarkshare_list.txt
fi

# 开启tvbox随机订阅
if [ "${TVBOX_SECURITY:=false}" = "true" ]; then
echo "已开启TVBOX安全模式..."
Expand Down
2 changes: 2 additions & 0 deletions env
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ALIYUN_TOKEN=
ALIYUN_OPEN_TOKEN=
# 阿里云盘文件夹ID
ALIYUN_FOLDER_ID=
# 夸克网盘的cookie
QUARK_COOKIE=
# 自动更新小雅alist文件
AUTO_UPDATE_ENABLED=true
# 自动清理阿里云盘
Expand Down
8 changes: 8 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,14 @@ data_location=${res:-${data_location}}
token=""
open_token=""
folder_id=""
quark_cookie=""

# 如果是更新服务,则从原有的compose配置中获取token等信息
if [ "${update}" != "0" ]; then
token=$(grep ALIYUN_TOKEN "$install_path/env" 2> /dev/null | awk -F '=' '{print $2}')
open_token=$(grep ALIYUN_OPEN_TOKEN "$install_path/env" 2> /dev/null | awk -F '=' '{print $2}')
folder_id=$(grep ALIYUN_FOLDER_ID "$install_path/env" 2> /dev/null | awk -F '=' '{print $2}')
quark_cookie=$(grep QUARK_COOKIE "$install_path/env" 2> /dev/null | awk -F '=' '{print $2}')
fi

# 让用户输入阿里云盘TOKEN,token获取方式教程:https://alist.nn.ci/zh/guide/drivers/aliyundrive.html
Expand Down Expand Up @@ -162,6 +164,11 @@ if [ ${#folder_id} -ne 40 ]; then
exit 1
fi

echo
echo "登陆夸克网盘,浏览器F12,点击network,随便点一个请求,找到里面的Cookie值"
read -rp "请输入夸克网盘Cookie值: " res
quark_cookie=${res:=quark_cookie}

# 选择部署服务类型,alist + emby (默认), alist, alist + jellyfin, alist + emby + jellyfin
echo
echo "部署类型:"
Expand Down Expand Up @@ -204,6 +211,7 @@ fi
sedsh "s#ALIYUN_TOKEN=.*#ALIYUN_TOKEN=$token#g" env
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

if [ -n "$IMAGE_PROXY" ]; then
sedsh -E "s#image: [^/]+#image: ${IMAGE_PROXY}#g" docker-compose.yml
Expand Down

0 comments on commit 59e6556

Please sign in to comment.