Code Monkey home page Code Monkey logo

koushare-dl's People

Contributors

yliu7949 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

koushare-dl's Issues

异常错误

panic: runtime error: slice bounds out of range [-1:]

goroutine 1 [running]:
github.com/yliu7949/KouShare-dl/live.(*Live).getNewTsURLBym3u8(0xc0000e86c0)
github.com/yliu7949/KouShare-dl/live/live.go:276 +0x13e
github.com/yliu7949/KouShare-dl/live.(*Live).recordLive(0xc0000e86c0, 0x1)
github.com/yliu7949/KouShare-dl/live/live.go:251 +0xee
github.com/yliu7949/KouShare-dl/live.(*Live).WaitAndRecordTheLive(0xc0000e86c0, {0x0?, 0x0?}, 0xcb?)
github.com/yliu7949/KouShare-dl/live/live.go:143 +0xbbd
github.com/yliu7949/KouShare-dl/cmd/ks.RecordCmd.func1(0xc000004f00?, {0xc000112180?, 0x2?, 0x2?})
github.com/yliu7949/KouShare-dl/cmd/ks/commands.go:123 +0x172
github.com/spf13/cobra.(*Command).execute(0xc000004f00, {0xc000112160, 0x2, 0x2})
github.com/spf13/[email protected]/command.go:944 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0xc000004300)
github.com/spf13/[email protected]/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:992
main.main()
./ks.go:34 +0x334

mac 如何用呀谢谢

win的这个步骤我知道怎么用(cd C:\Users\lenovo\Downloads
ks version),mac如何输入进入呀

ks clean 命令:清理指定目录下的所有 tmp 文件

新增 ks clean 命令用以清理指定目录下的所有下载过程中产生的 tmp 临时文件。

--path, -p 标志用于指定要清理的目录。--quiet, -q 标志用于指定是否在清理过程中输出已清理的文件名。

示例:ks clean -p="C:\Users\lenovo\Downloads" -q

彩色终端输出

部分提示文字和进度条数字在各个终端下显示为彩色。使用--nocolor标志表明不使用彩色输出。

能不能同时下载会议的信息生成一个nfo文件?方便导入类似Jellyfin等媒体管理软件中使用。

能不能同时下载会议的信息生成一个nfo文件(最好和视频文件名一致)?方便导入类似Jellyfin、plex等媒体管理软件中使用。

jellyfin的nfo文件的一些介绍参考:https://jellyfin.org/docs/general/server/metadata/nfo/

比如以下信息:

  • 关联专题(可以定义为“合集”):[XXX](https://www.koushare.com/topic-sc/i/XXXXXXX
  • DOI:https://dx.doi.org/XXX
  • bib文件(网站上可以下载),或者GB/T 7714等引用格式
  • 报告题目:XXX
  • 报告地点:XXX
  • 报告时间:XXX
  • 主办方:XXX
  • 视频摘要:XXX
  • 报告人:XXX
  • 视频标签:XXX
  • 视频封面的图片

手机号码格式不正确

我的手机号是191开头的,但是输入进去显示手机号码格式不正确,希望解决一下

保存文件时允许使用vid作为前缀

save 命令新增 -v, --vidPrefix 标志,指定是否使用 vid 作为保存视频文件名的前缀。

ks save 2233 -v 命令为例,最终得到的 mp4 文件名为:2233_(Lecture44) Studying Statistical Physics Properties of Soft Matter by Molecular Simulation Methods_标清.mp4,即 vid_视频名_清晰度.mp4 的格式。

save batch 命令中也可以使用该标志。

info命令支持查询直播信息

使用ks info [roomID]命令可以查询直播的详细信息,包括标题、直播状态、主办方、开播时间、有无回放、浏览次数、专题以及最新通知等。

系列名中有特殊符号时,创建文件夹错误

如:Lecture 1: Defect Calculation in Semiconductors: Concept, Calculation and Control 标题中使用了 :
mkdir .\Defect Calculation in Semiconductors: Concept, Calculation and Control_videos\: The directory name is invalid

程序:ks.exe
操作系统:windows
测试终端:powershell

反馈一个运行时的报错

在录制直播时出现的报错,随后程序停止了运行,报错信息如下

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x40 pc=0x55c168]

goroutine 1 [running]:
github.com/yliu7949/KouShare-dl/user.MyGetRequest({0xc00023e6c7?, 0xc000025098?}, {0x0, 0x0, 0x0?})
        github.com/yliu7949/KouShare-dl/user/user.go:177 +0x5c8
github.com/yliu7949/KouShare-dl/live.(*Live).getNewTsURLBym3u8(0xc0000fa0f0)
        github.com/yliu7949/KouShare-dl/live/live.go:207 +0x3a
github.com/yliu7949/KouShare-dl/live.(*Live).recordLive(0xc0000fa0f0, 0x0)
        github.com/yliu7949/KouShare-dl/live/live.go:188 +0x45
github.com/yliu7949/KouShare-dl/live.(*Live).WaitAndRecordTheLive(0xc0000fa0f0, {0x0?, 0x0?}, 0xb3?)
        github.com/yliu7949/KouShare-dl/live/live.go:96 +0x78b
github.com/yliu7949/KouShare-dl/cmd/ks.RecordCmd.func1(0xc0000f8900?, {0xc000072f70?, 0x1?, 0x1?})
        github.com/yliu7949/KouShare-dl/cmd/ks/commands.go:89 +0x137
github.com/spf13/cobra.(*Command).execute(0xc0000f8900, {0xc000072f40, 0x1, 0x1})
        github.com/spf13/[email protected]/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0xc0000f8000)
        github.com/spf13/[email protected]/command.go:1040 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/[email protected]/command.go:968
main.main()
        ./ks.go:34 +0x31a

随后再次执行ks record命令,报错误如下

登陆凭证有效。

Error: unknown command "PathtoKS\\ks.exe" for "ks"
Run 'ks --help' for usage.

第三次执行record命令后成功重新开始录制。

当前手机号未注册

我用手机号进行了注册,但是仍然显示如下的信息:

werner@x13dai-t:~/Public/repo/github.com/yliu7949/KouShare-dl.git$ ./ks login my-phone-number
当前手机号未注册

image

系列下载时文件命名有bug;以及文件命名的建议

一个bug:

下载某个专题系列里面的多个视频文件时,后续文件的名字会变成前面视频名称加上该视频名称的字符串,例如:AA_超清.mp4、AA_超清BB_超清.mp4、AA_超清BB_超清CC_超清.mp4……
版本:KouShare-dl v0.9.1,windows11系统。

还有一个建议:

希望下载视频的命名可以利用视频的“报告时间”(与“发布时间”有区别),比如“2023-XX-XX 标题”,或者 “2023-XX-XX 报告人.标题”等等,可以自定义。

自动判断直播计划并进行倒计时

如果不使用“-@, --at”标志来指定开始录制的时间,例如在 ks record 751111 -a 命令中,程序在未到开播时间时不会直接退出,而是将将根据开播时间启动倒计时功能。在倒计时结束时,程序会自动开始该直播间的录制。

下载视频时因源视频不存在而报错,自动跳过报错视频继续下载

例如 vid 为 21944 的视频,使用 ks info 21944 会显示体积为 0MB

可媲美脑神经元的非线性器件——高面积效率极低逻辑晶体管 (vid=21944):

        时长:Unknownmin            讲者:周鹏
        体积:0MB [标清]            单位:复旦大学
        日期:2022-01-14            专题:半语-益言系列讲座
        类别:免费视频              分组:“半语-益言”特别直播:2021年“**半导体十大研究进展”候选成果

        视频简介:(无)

使用 ks save 21944 下载视频时会 panic:

可媲美脑神经元的非线性器件——高面积效率极低逻辑晶体管    vid=21944       标清
 [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 100%    0.00MB/0.00MB

rename ./可媲美脑神经元的非线性器件——高面积效率极低逻辑晶体管_标清.tmp ./可媲美脑神经元的非线性器件——高面积效率极低逻辑
晶体管_标清.mp4: The process cannot access the file because it is being used by another process.
panic: runtime error: invalid memory address or nil pointer dereference
        panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x40 pc=0x12cf59c]

goroutine 1 [running]:
github.com/yliu7949/KouShare-dl/video.(*Video).DownloadSingleVideo.func1()
        github.com/yliu7949/KouShare-dl/video/video.go:139 +0x1c
panic({0x131b560, 0x163a090})
        runtime/panic.go:884 +0x212
github.com/yliu7949/KouShare-dl/video.(*Video).DownloadSingleVideo(0xc0001846e0, {0x136e0b2, 0x4})
        github.com/yliu7949/KouShare-dl/video/video.go:162 +0x1464
github.com/yliu7949/KouShare-dl/cmd/ks.SaveCmd.func1(0xc0001a2600?, {0xc00005e150?, 0x1?, 0x1?})
        github.com/yliu7949/KouShare-dl/cmd/ks/commands.go:58 +0x127
github.com/spf13/cobra.(*Command).execute(0xc0001a2600, {0xc00005e120, 0x1, 0x1})
        github.com/spf13/[email protected]/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0xc0001a2000)
        github.com/spf13/[email protected]/command.go:1040 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/[email protected]/command.go:968
main.main()
        ./ks.go:34 +0x31a

同时生成了一个 0KBtmp 文件。

课件pdf下载

课件pdf不是依附于视频,而是在一个单独的课程资源页面,这种情况怎么下载课件的pdf?

info 命令增加了对需要密码的直播间的提示

有些直播间,例如 RoomID 为 283276 的直播间需要密码才能访问。执行 ks info 283276 命令会看到“该直播间需要密码”的提示:

**科学技术大学2023毕业典礼 (roomID=283276):

        直播状态:直播已结束            主办单位:**科学技术大学
        开播时间:2023-06-25 09:00:00   有无回放:[有回放]
        浏览次数:80039                 专题:(无)

        ※该直播间需要密码

        最新通知:直播结束。感谢主持人、报告人和各位老师同学的参与,更多内容请关注蔻享学术网站(www.koushare.com)、APP (蔻享学术)、公众号(蔻享学术)。

live 命令支持使用密码录制需要密码的直播间。例如:ks live 283276 --password="123456"。若密码错误,会得到“直播间密码不正确”的提示。

直播录制下载之后,进行合并时报错

直播录制之后进行下载(不知道是不是因为只下载了部分的原因,没有等完全下载完毕就ctrl+c终止了程序,感觉这一点是有必要的,因为有的会议是连着的,但是只想录制某个报告人的视频),最后合并的时候报错如下:

开始合并视频文件...
panic: runtime error: slice bounds out of range [-1:]

goroutine 1 [running]:
github.com/yliu7949/KouShare-dl/live.MergeTsFiles.func1({0x0?, 0xc0003c9740?}, {0x12a0d38, 0xc0003a1340}, {0xc0000695c8?, 0xf8751a?})
        github.com/yliu7949/KouShare-dl/live/live.go:309 +0x229
path/filepath.walk({0xc0003c9740, 0x2c}, {0x12a0d38, 0xc0003a1340}, 0xc000069bd0)
        path/filepath/path.go:433 +0x123
path/filepath.walk({0xc0003c8030, 0x29}, {0x12a0d38, 0xc00041e070}, 0xc000069bd0)
        path/filepath/path.go:457 +0x285
path/filepath.walk({0xc00034c600, 0x20}, {0x12a0d38, 0xc0003a1a40}, 0xc000069bd0)
        path/filepath/path.go:457 +0x285
path/filepath.walk({0xc00034d1a0, 0x1b}, {0x12a0d38, 0xc0003c1b20}, 0xc000069bd0)
        path/filepath/path.go:457 +0x285
path/filepath.walk({0xc00000f5c0, 0xd}, {0x12a0d38, 0xc00015f110}, 0xc000069bd0)
        path/filepath/path.go:457 +0x285
path/filepath.walk({0xc00000f1c0, 0x9}, {0x12a0d38, 0xc00015e1c0}, 0xc000069bd0)
        path/filepath/path.go:457 +0x285
path/filepath.walk({0x11edb0b, 0x2}, {0x12a0d38, 0xc00015e000}, 0xc000069bd0)
        path/filepath/path.go:457 +0x285
path/filepath.Walk({0x11edb0b, 0x2}, 0xc000107bd0)
        path/filepath/path.go:520 +0x6c
github.com/yliu7949/KouShare-dl/live.MergeTsFiles({0x11edb0b, 0x2}, {0xc00000e0d8, 0x8})
        github.com/yliu7949/KouShare-dl/live/live.go:305 +0x132
github.com/yliu7949/KouShare-dl/cmd/ks.MergeCmd.func1(0xc00014cc00?, {0xc0000509a0?, 0x2?, 0x2?})
        github.com/yliu7949/KouShare-dl/cmd/ks/commands.go:121 +0x116
github.com/spf13/cobra.(*Command).execute(0xc00014cc00, {0xc000050980, 0x2, 0x2})
        github.com/spf13/[email protected]/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0xc00014c000)
        github.com/spf13/[email protected]/command.go:1040 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/[email protected]/command.go:968
main.main()
        ./ks.go:34 +0x31a

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.