Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多线程下载时正则表达式解析错误 #657

Closed
gabriel254 opened this issue Apr 3, 2020 · 0 comments · Fixed by #679
Closed

多线程下载时正则表达式解析错误 #657

gabriel254 opened this issue Apr 3, 2020 · 0 comments · Fixed by #679

Comments

@gabriel254
Copy link

如果使用-m开启多线程下载,当文件名filename中间包含正则表达式中的转义字符时会出现如下错误

error parsing regexp: invalid character class range: `1-0`

具体是下面这行code实现有问题:
https://github.com/iawia002/annie/blob/c24fbc04b8260cc5923af12be9baf30d35735325/downloader/downloader.go#L388

举例:

pattern := "test P1 [2020-01-01].flv.part.+"
reg := regexp.MustCompile(pattern)

会错把[2020-01-01]当成正则表达式去解析而导致出错

M1178475702 added a commit to M1178475702/annie that referenced this issue Apr 15, 2020
1. 生成part文件时将文件名md5,避免出现特殊字符导致
M1178475702 added a commit to M1178475702/annie that referenced this issue Apr 15, 2020
M1178475702 added a commit to M1178475702/annie that referenced this issue Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant