shenxianmq / Auto_Symlink

实时监控文件夹,创建与更新软链接/strm文件,自动复制与更新元数据,清空无效文件夹,清空无效软链接
631 stars 67 forks source link

采用rclone+alist获取到的strm有些问题 #9

Closed hurttttr closed 4 months ago

hurttttr commented 9 months ago

获取的strm中应改是该文件的直链,alist的直链在默认设置下是永久的(在管理-设置-全局中可以查看,默认0),直链样式应该为http://{cloud_url}/d/{target_file}?sign={sign} 以下是我尝试获取的代码,希望能帮助你加快开发,同时在添加同步时需要获取alist的username和password

import requests
import json

ip = ''

payload = {"username": "", "password": ""}
headers1 = {
    'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
    'Content-Type': 'application/json'
}
authorization = json.loads(
    requests.post(url=f"http://{ip}/api/auth/login",
                  json=payload,
                  headers=headers1).text)['data']['token']

url = f'http://{ip}/api/fs/list'

headers = {
    'User-Agent':
    'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
    'Authorization': authorization
}
data = {
    'page': 1,
    'password': "",
    'path': "/",
    'per_page': 0,
    'refresh': False
}

data = json.loads(requests.post(url=url, headers=headers,
                                json=data).text)['data']['content']
for i in data:
    print(i['name'], i['sign'])
hurttttr commented 9 months ago

没事了,没看到那个的签名所有,希望大佬有时间可以补充一下文档

karasfjm commented 9 months ago

大佬,rclone挂载的ALIST怎么设置,我弄完生成出来的是这样的: http://192.168.3.129:5244/d/%2F%E8%87%AA%E7%94%A8%2F%E9%98%BF%E9%87%8C%2F%E5%8A%A8%E7%94%BB%2F%E5%BE%85%E6%89%AB%2F%E5%AE%8C%E7%BB%93%2F%E5%8A%A8%E6%BC%AB%2F%E5%87%A1%E4%BA%BA%E4%BF%AE%E4%BB%99%E4%BC%A0%20%282020%29%2FSeason%201%2F%E5%87%A1%E4%BA%BA%E4%BF%AE%E4%BB%99%E4%BC%A0%20-%20S01E80%20-%20106449.mp4

sjtuross commented 8 months ago

为了安全,希望适配alist的签名sign,类似实现:https://github.com/Akimio521/AutoFilm/pull/17

hurttttr commented 8 months ago

大佬,rclone挂载的ALIST怎么设置,我弄完生成出来的是这样的: http://192.168.3.129:5244/d/%2F%E8%87%AA%E7%94%A8%2F%E9%98%BF%E9%87%8C%2F%E5%8A%A8%E7%94%BB%2F%E5%BE%85%E6%89%AB%2F%E5%AE%8C%E7%BB%93%2F%E5%8A%A8%E6%BC%AB%2F%E5%87%A1%E4%BA%BA%E4%BF%AE%E4%BB%99%E4%BC%A0%20%282020%29%2FSeason%201%2F%E5%87%A1%E4%BA%BA%E4%BF%AE%E4%BB%99%E4%BC%A0%20-%20S01E80%20-%20106449.mp4

这个就是正常的,原链接经过编码了而已

liuhangbin commented 5 months ago

请教一下各位,为啥我的alist 直链生成的是没有 /d 的格式呢? 比如 ip:port/115/xxx/xxx.mkv。网上搜索了一下,看到有个人遇到跟我一样的问题 https://github.com/jxxghp/MoviePilot/issues/1330 。 为什么你们的生成出来有 /d 呢?