Replies: 3 comments 8 replies
-
如果文件放在原地应该会自动跳过呀,我不是太明白这个需求,能说详细点吗? |
Beta Was this translation helpful? Give feedback.
2 replies
-
这也是不喜欢用官方客户端的原因之一,客户端每天要一集一集选来看,脚本的话就不用去关心up是否更新了,看文件夹下有没有自动下载好的就行,每天都是最新的,看完就完了 ,😄 不知道这样描述您听明白了没有,感谢🙏 |
Beta Was this translation helpful? Give feedback.
0 replies
-
根据你的描述,我看了yt-dlp的--download-archive参数,似乎这需要我们提供一个文件,该文件记录了已经下载过的文件名(或者url?),那么要生成这个文件可能自己写脚本来做,那么我非常推荐你直接将bilix作为python库配合定时任务的库apscheduler进行使用,因为你的需求已经比较特化了,所以不再推荐使用命令行的方式。 import asyncio
import bilix.api.bilibili as api
from bilix.download import DownloaderBilibili
downloaded = set()
async def download_up():
global downloaded
d = DownloaderBilibili()
up_name, total_size, bv_ids = await api.get_up_info(d.client, '49038549', order='pubdate')
await asyncio.gather(*[
d.get_series(f"https://www.bilibili.com/video/{bv}") for bv in bv_ids if bv not in downloaded
])
downloaded = downloaded.union(bv_ids)
def task():
asyncio.run(download_up())
if __name__ == '__main__':
from apscheduler.schedulers.blocking import BlockingScheduler
scheduler = BlockingScheduler()
scheduler.add_job(task, trigger="interval", seconds=10)
scheduler.start() 这样即使你删除了已经下载好的文件,由于被记录在了全局变量 |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
这对定时自动下载脚本很有用,希望支持,谢谢!
Beta Was this translation helpful? Give feedback.
All reactions