Code Monkey home page Code Monkey logo

lux's Introduction

Lux

Let there be Lux!

👾 Lux is a fast and simple video downloader built with Go.

Installation

Prerequisites

The following dependencies are required and must be installed separately.

Note: FFmpeg does not affect the download, only affects the final file merge.

Install via go install

To install Lux, use go install, or download the binary file from Releases page.

$ go install github.com/iawia002/lux@latest

Homebrew (macOS only)

For macOS users, you can install lux via:

$ brew install lux

Arch Linux

For Arch Users AUR package is available.

Void Linux

For Void linux users, you can install lux via:

$ xbps-install -S lux

Scoop on Windows

$ scoop install lux

Chocolatey on Windows

$ choco install lux

Cask on Windows/macOS/Linux

$ cask install github.com/iawia002/lux

Getting Started

Usage:

lux [OPTIONS] URL [URL...]

Download a video

$ lux "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

 Site:      YouTube youtube.com
 Title:     Rick Astley - Never Gonna Give You Up (Video)
 Type:      video
 Stream:
     [248]  -------------------
     Quality:         1080p video/webm; codecs="vp9"
     Size:            63.93 MiB (67038963 Bytes)
     # download with: lux -f 248 ...

 41.88 MiB / 63.93 MiB [=================>-------------]  65.51% 4.22 MiB/s 00m05s

The -i option displays all available quality of video without downloading.

$ lux -i "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

 Site:      YouTube youtube.com
 Title:     Rick Astley - Never Gonna Give You Up (Video)
 Type:      video
 Streams:   # All available quality
     [248]  -------------------
     Quality:         1080p video/webm; codecs="vp9"
     Size:            49.29 MiB (51687554 Bytes)
     # download with: lux -f 248 ...

     [137]  -------------------
     Quality:         1080p video/mp4; codecs="avc1.640028"
     Size:            43.45 MiB (45564306 Bytes)
     # download with: lux -f 137 ...

     [398]  -------------------
     Quality:         720p video/mp4; codecs="av01.0.05M.08"
     Size:            37.12 MiB (38926432 Bytes)
     # download with: lux -f 398 ...

     [136]  -------------------
     Quality:         720p video/mp4; codecs="avc1.4d401f"
     Size:            31.34 MiB (32867324 Bytes)
     # download with: lux -f 136 ...

     [247]  -------------------
     Quality:         720p video/webm; codecs="vp9"
     Size:            31.03 MiB (32536181 Bytes)
     # download with: lux -f 247 ...

Use lux -f stream "URL" to download a specific stream listed in the output of -i option.

Download anything else

If Lux is provided the URL of a specific resource, then it will be downloaded directly:

$ lux "https://img9.bcyimg.com/drawer/15294/post/1799t/1f5a87801a0711e898b12b640777720f.jpg"

lux doesn't support this URL right now, but it will try to download it directly

 Site:      Universal
 Title:     1f5a87801a0711e898b12b640777720f
 Type:      image/jpeg
 Stream:
     [default]  -------------------
     Size:            1.00 MiB (1051042 Bytes)
     # download with: lux -f default "URL"

 1.00 MiB / 1.00 MiB [===================================] 100.00% 1.21 MiB/s 0s

Download playlist

The -p option downloads an entire playlist instead of a single video.

$ lux -i -p "https://www.bilibili.com/bangumi/play/ep198061"

 Site:      哔哩哔哩 bilibili.com
 Title:     Doctor X 第四季:第一集
 Type:      video
 Streams:   # All available quality
     [default]  -------------------
     Quality:         高清 1080P
     Size:            845.66 MiB (886738354 Bytes)
     # download with: lux -f default "URL"


 Site:      哔哩哔哩 bilibili.com
 Title:     Doctor X 第四季:第二集
 Type:      video
 Streams:   # All available quality
     [default]  -------------------
     Quality:         高清 1080P
     Size:            930.71 MiB (975919195 Bytes)
     # download with: lux -f default "URL"

......

You can use the -start, -end or -items option to specify the download range of the list:

-start
    	Playlist video to start at (default 1)
-end
    	Playlist video to end at
-items
    	Playlist video items to download. Separated by commas like: 1,5,6,8-10

For bilibili playlists only:

-eto
  File name of each bilibili episode doesn't include the playlist title

Multiple inputs

You can also download multiple URLs at once:

$ lux -i "https://www.bilibili.com/video/av21877586" "https://www.bilibili.com/video/av21990740"

 Site:      哔哩哔哩 bilibili.com
 Title:     【莓机会了】甜到虐哭的13集单集MAD「我现在什么都不想干,更不想看14集」
 Type:      video
 Streams:   # All available quality
     [default]  -------------------
     Quality:         高清 1080P
     Size:            51.88 MiB (54403767 Bytes)
     # download with: lux -f default "URL"


 Site:      哔哩哔哩 bilibili.com
 Title:     【莓救了】甜到虐哭!!!国家队单集MAD-当熟悉的bgm响起,眼泪从脸颊滑下
 Type:      video
 Streams:   # All available quality
     [default]  -------------------
     Quality:         高清 1080P
     Size:            77.63 MiB (81404093 Bytes)
     # download with: lux -f default "URL"

These URLs will be downloaded one by one.

You can also use the -F option to read URLs from file:

$ lux -F ~/Desktop/u.txt

 Site:      微博 weibo.com
 Title:     在Google,我们设计什么? via@阑夕
 Type:      video
 Stream:
     [default]  -------------------
     Size:            19.19 MiB (20118196 Bytes)
     # download with: lux -f default "URL"

 19.19 MiB / 19.19 MiB [=================================] 100.00% 9.69 MiB/s 1s

......

You can use the -start, -end or -items option to specify the download range of the list:

-start
    	File line to start at (default 1)
-end
    	File line to end at
-items
    	File lines to download. Separated by commas like: 1,5,6,8-10

Resume a download

Ctrl+C interrupts a download.

A temporary .download file is kept in the output directory. If lux is ran with the same arguments, then the download progress will resume from the last session.

Auto retry

lux will auto retry when the download failed, you can specify the retry times by -retry option (default is 100).

Cookies

Cookies can be provided to lux with the -c option if they are required for accessing the video.

Cookies can be the following format or Netscape Cookie format:

name=value; name2=value2; ...

Cookies can be a string or a text file, supply cookies in one of the two following ways.

As a string:

$ lux -c "name=value; name2=value2" "https://www.bilibili.com/video/av20203945"

As a text file:

$ lux -c cookies.txt "https://www.bilibili.com/video/av20203945"

Proxy

You can set the HTTP/SOCKS5 proxy using environment variables:

$ HTTP_PROXY="http://127.0.0.1:1087/" lux -i "https://www.youtube.com/watch?v=Gnbch2osEeo"
$ HTTP_PROXY="socks5://127.0.0.1:1080/" lux -i "https://www.youtube.com/watch?v=Gnbch2osEeo"

Multi-Thread

Use --multi-thread or -m multiple threads to download single video.

Use --thread or -n option to set the number of download threads(default is 10).

Note: If the video has multi fragment, the number of actual download threads will increase.

For example:

  • If -n is set to 10, and the video has 2 fragments, then 20 threads will actually be used.
  • If the video has 20 fragments, only 10 fragments are downloaded in the same time, the actual threads count is 100.

Special Tips: Use too many threads in mgtv download will cause HTTP 403 error, we recommend setting the number of threads to 1.

Short link

bilibili

You can just use av or ep number to download bilibili's video:

$ lux -i ep198381 av21877586

 Site:      哔哩哔哩 bilibili.com
 Title:     狐妖小红娘:第79话 南国公主的吃货本色
 Type:      video
 Streams:   # All available quality
     [default]  -------------------
     Quality:         高清 1080P
     Size:            485.23 MiB (508798478 Bytes)
     # download with: lux -f default "URL"


 Site:      哔哩哔哩 bilibili.com
 Title:     【莓机会了】甜到虐哭的13集单集MAD「我现在什么都不想干,更不想看14集」
 Type:      video
 Streams:   # All available quality
     [default]  -------------------
     Quality:         高清 1080P
     Size:            51.88 MiB (54403767 Bytes)
     # download with: lux -f default "URL"

Use specified Referrer

A Referrer can be used for the request with the -r option:

$ lux -r "https://www.bilibili.com/video/av20383055/" "http://cn-scnc1-dx.acgvideo.com/"

Specify the output path and name

The -o option sets the path, and -O option sets the name of the downloaded file:

$ lux -o ../ -O "hello" "https://example.com"

Debug Mode

The -d option outputs network request messages:

$ lux -i -d "http://www.bilibili.com/video/av20088587"

URL:         http://www.bilibili.com/video/av20088587
Method:      GET
Headers:     http.Header{
    "Referer":         {"http://www.bilibili.com/video/av20088587"},
    "Accept":          {"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},
    "Accept-Charset":  {"UTF-8,*;q=0.5"},
    "Accept-Encoding": {"gzip,deflate,sdch"},
    "Accept-Language": {"en-US,en;q=0.8"},
    "User-Agent":      {"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36"},
}
Status Code: 200

URL:         https://interface.bilibili.com/v2/playurl?appkey=84956560bc028eb7&cid=32782944&otype=json&qn=116&quality=116&type=&sign=fb2e3f261fec398652f96d358517e535
Method:      GET
Headers:     http.Header{
    "Accept-Charset":  {"UTF-8,*;q=0.5"},
    "Accept-Encoding": {"gzip,deflate,sdch"},
    "Accept-Language": {"en-US,en;q=0.8"},
    "User-Agent":      {"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36"},
    "Referer":         {"https://interface.bilibili.com/v2/playurl?appkey=84956560bc028eb7&cid=32782944&otype=json&qn=116&quality=116&type=&sign=fb2e3f261fec398652f96d358517e535"},
    "Accept":          {"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},
}
Status Code: 200

 Site:      哔哩哔哩 bilibili.com
 Title:     燃油动力的遥控奥迪R8跑赛道
 Type:      video
 Streams:   # All available quality
     [default]  -------------------
     Quality:         高清 1080P
     Size:            64.38 MiB (67504795 Bytes)
     # download with: lux -f default "URL"

Reuse extracted data

The -j option will print the extracted data in JSON format.

$ lux -j "https://www.bilibili.com/video/av20203945"

{
    "site": "哔哩哔哩 bilibili.com",
    "title": "【2018拜年祭单品】相遇day by day",
    "type": "video",
    "streams": {
        "15": {
            "urls": [
                {
                    "url": "...",
                    "size": 18355205,
                    "ext": "flv"
                }
            ],
            "quality": "流畅 360P",
            "size": 18355205
        },
        "32": {
            "urls": [
                {
                    "url": "...",
                    "size": 40058632,
                    "ext": "flv"
                }
            ],
            "quality": "清晰 480P",
            "size": 40058632
        },
        "64": {
            "urls": [
                {
                    "url": "...",
                    "size": 82691087,
                    "ext": "flv"
                }
            ],
            "quality": "高清 720P",
            "size": 82691087
        },
        "80": {
            "urls": [
                {
                    "url": "...",
                    "size": 121735559,
                    "ext": "flv"
                }
            ],
            "quality": "高清 1080P",
            "size": 121735559
        }
    }
}

Options

  -i	Information only
  -F string
    	URLs file path
  -d	Debug mode
  -j	Print extracted data
  -s	Minimum outputs
  -v	Show version

Download:

  -f string
    	Select specific stream to download
  -p	Download playlist
  -n int
    	The number of download thread (only works for multiple-parts video) (default 10)
  -c string
    	Cookie
  -r string
    	Use specified Referrer
  -cs int
    	HTTP chunk size for downloading (in MB) (default 1)

Network:

  -retry int
    	How many times to retry when the download failed (default 10)

Playlist:

  -start int
    	Playlist video to start at (default 1)
  -end int
    	Playlist video to end at
  -items string
    	Playlist video items to download. Separated by commas like: 1,5,6,8-10

Filesystem:

  -o string
    	Specify the output path
  -O string
    	Specify the output file name

Subtitle:

  -C	Download captions

Youku:

  -ccode string
    	Youku ccode (default "0502")
  -ckey string
    	Youku ckey (default "7B19C0AB12633B22E7FE81271162026020570708D6CC189E4924503C49D243A0DE6CD84A766832C2C99898FC5ED31F3709BB3CDD82C96492E721BDD381735026")
  -password string
    	Youku password

aria2:

Note: If you use aria2 to download, you need to merge the multi-part videos yourself.

  -aria2
    	Use Aria2 RPC to download
  -aria2addr string
    	Aria2 Address (default "localhost:6800")
  -aria2method string
    	Aria2 Method (default "http")
  -aria2token string
    	Aria2 RPC Token

Supported Sites

Site URL 🎬 Videos 🌁 Images 🔊 Audio 📚 Playlist 🍪 VIP adaptation Build Status
抖音 https://www.douyin.com douyin
哔哩哔哩 https://www.bilibili.com bilibili
半次元 https://bcy.net bcy
pixivision https://www.pixivision.net pixivision
优酷 https://www.youku.com youku
YouTube https://www.youtube.com youtube
西瓜视频(头条) https://m.toutiao.com, https://v.ixigua.com, https://www.ixigua.com ixigua
爱奇艺 https://www.iqiyi.com iqiyi
新片场 https://www.xinpianchang.com xinpianchang
芒果 TV https://www.mgtv.com mgtv
糖豆广场舞 https://www.tangdou.com tangdou
Tumblr https://www.tumblr.com tumblr
Vimeo https://vimeo.com vimeo
Facebook https://facebook.com facebook
斗鱼视频 https://v.douyu.com douyu
秒拍 https://www.miaopai.com miaopai
微博 https://weibo.com weibo
Instagram https://www.instagram.com instagram
Twitter https://twitter.com twitter
腾讯视频 https://v.qq.com qq
网易云音乐 https://music.163.com netease
音悦台 https://yinyuetai.com yinyuetai
极客时间 https://time.geekbang.org geekbang
Pornhub https://pornhub.com pornhub
XVIDEOS https://xvideos.com xvideos
聯合新聞網 https://udn.com udn
TikTok https://www.tiktok.com tiktok
Pinterest https://www.pinterest.com pinterest
好看视频 https://haokan.baidu.com haokan
AcFun https://www.acfun.cn acfun
Eporner https://eporner.com eporner
StreamTape https://streamtape.com streamtape
虎扑 https://hupu.com hupu
虎牙视频 https://v.huya.com huya
喜马拉雅 https://www.ximalaya.com ximalaya
快手 https://www.kuaishou.com kuaishou
Reddit https://www.reddit.com reddit
VKontakte https://vk.com vk
知乎 https://zhihu.com zhihu
Rumble https://rumble.com rumble
小红书 https://xiaohongshu.com xiaohongshu
Zing MP3 https://zingmp3.vn zingmp3

Known issues

优酷

优酷的 ccode 经常变化导致 lux 不可用,如果你知道有新的可用的 ccode,可以直接使用 lux -ccode ... 而不用等待 lux 更新(当然,也欢迎你给我们提一个 Pull request 来更新默认的 ccode

最好是每次下载都附带登录过的 Cookie 以避免部分 ccode 的问题

西瓜/头条视频

西瓜/头条视频必须带 Cookie 才能下载成功,西瓜和头条可共用西瓜视频的 Cookie,Cookie 的有效期可能较短,下载失败就更新 Cookie 尝试:

$ lux -c "msToken=yoEh0-qLUq4obZ8Sfxsem_CxCo9R3NM6ViTrWaRcM1...; ttwid=1%7C..." "https://m.toutiao.com/is/iYbTfJ79/"

Contributing

Lux is an open source project and built on the top of open-source projects. Check out the Contributing Guide to get started.

Thanks for JetBrains for the wonderful IDE.

Authors

Code with ❤️ by iawia002 and lovely contributors

Similar projects

License

MIT

Copyright (c) 2018-present, iawia002

lux's People

Contributors

amakerlife avatar arpit1997 avatar axetroy avatar bigtan avatar chinuno-usami avatar cxjava avatar dependabot[bot] avatar dfang avatar half9000 avatar hezhizhen avatar hguandl avatar iawia002 avatar joeke80215 avatar joekyo avatar jpacg avatar kilosonc avatar lazzyfatty avatar leehow1988 avatar lishubing avatar mathieu-aubin avatar misakatat avatar nathaniel-wu avatar nilsocket avatar saltcoffee avatar shavit avatar stegosawr avatar waybackarchiver avatar weiyongsheng avatar xjohn600 avatar youmoo 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  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

lux's Issues

Panic downloading video

With 4315740 I got the following output downloading a YouTube playlist, behind an HTTP proxy :

panic: Get https://www.youtube.com/watch?v=lLOvB1qFE1E&gl=US&hl=en&has_verified=1&bpctr=9999999999: Bad Gateway

goroutine 1 [running]:
github.com/iawia002/annie/request.Request(0x70a4cf, 0x3, 0xc4204a0240, 0x57, 0x0, 0x0, 0x0, 0xc4204a0240)
	/home/lamg/go/src/github.com/iawia002/annie/request/request.go:88 +0xc7b
github.com/iawia002/annie/request.Get(0xc4204a0240, 0x57, 0x0, 0x0)
	/home/lamg/go/src/github.com/iawia002/annie/request/request.go:111 +0x7b
github.com/iawia002/annie/extractors.youtubeDownload(0xc4204a01e0, 0x53, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/home/lamg/go/src/github.com/iawia002/annie/extractors/youtube.go:71 +0x16b
github.com/iawia002/annie/extractors.Youtube(0x7ffcacfc62d0, 0x44)
	/home/lamg/go/src/github.com/iawia002/annie/extractors/youtube.go:52 +0x21c
main.main()
	/home/lamg/go/src/github.com/iawia002/annie/main.go:60 +0x428

优酷下载失败

annie https://v.youku.com/v_show/id_XMzQ2NzU2NTg0MA.html -d
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/iawia002/annie/extractors.genData(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6, 0x8, ...)
/Users/mac/iawia002/go/src/github.com/iawia002/annie/extractors/youku.go:83 +0x4e7
github.com/iawia002/annie/extractors.Youku(0x7fff88f748d3, 0x32, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/mac/iawia002/go/src/github.com/iawia002/annie/extractors/youku.go:111 +0x185
main.main()
/Users/mac/iawia002/go/src/github.com/iawia002/annie/main.go:55 +0x247

flag provided but not defined: -f

Hey, when I try to download with

$ annie -f default https://www.youtube.com/watch?v=x2P7nDtXg-A

I got message like this : flag provided but not defined: -f
And if

$ annie -h

The message show without -f flag

Usage of annie:
  -c string
    	Cookie
  -d	Debug mode
  -i	Information only
  -p	Download playlist
  -r string
    	Use specified Referrer
  -s string
    	SOCKS5 proxy
  -v	Show version
  -x string
    	HTTP proxy

annie: version 0.5.1
MacOS High Sierra 10.13.3

issue when parse some ytb url

annie -d -x http://127.0.0.1:1080 https://www.youtube.com/watch?v=TUk7q9zRoJI

URL:         https://www.youtube.com/watch?v=TUk7q9zRoJI&gl=US&hl=en&has_verified=1&bpctr=9999999999
Method:      GET
Headers:     http.Header{
    "Accept-Charset":  {"UTF-8,*;q=0.5"},
    "Accept-Encoding": {"gzip,deflate,sdch"},
    "Accept-Language": {"en-US,en;q=0.8"},
    "User-Agent":      {"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36"},
    "Accept":          {"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},
    "Referer":         {"https://www.youtube.com/watch?v=TUk7q9zRoJI&gl=US&hl=en&has_verified=1&bpctr=9999999999"},
}
Status Code: 200

URL:         https://r4---sn-npoe7ne7.googlevideo.com/videoplayback?sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cexpire&signature=B754D49187CD23D2AD340227686D873154B0C283.0DB8821996F763497F09C13525D362A495CA4CA5&ip=47.88.154.139&requiressl=yes&ratebypass=yes&source=youtube&c=WEB&mn=sn-npoe7ne7%2Csn-npoeenez&mime=video%2Fmp4&id=o-AMuUfY5VzMbHNV3_l_6_4yXtSlIGhaHtf_mZqWbnYtiP&initcwndbps=1495000&ipbits=0&expire=1521570336&mm=31%2C29&fvip=4&ms=au%2Crdu&ei=wP2wWvPYDMiWqQGa04XYCA&pl=22&itag=22&mt=1521548651&dur=204.103&key=yt6&lmt=1506724426906456&mv=m
Method:      GET
Headers:     http.Header{
    "Accept-Encoding": {"gzip,deflate,sdch"},
    "Referer":         {"https://www.youtube.com/watch?v=TUk7q9zRoJI"},
    "Accept-Language": {"en-US,en;q=0.8"},
    "User-Agent":      {"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36"},
    "Accept":          {"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},
    "Accept-Charset":  {"UTF-8,*;q=0.5"},
}
Status Code: 200

   Site:   YouTube youtube.com
  Title:   冯提莫《我想对你说baby》 "I want to say to you, baby" Feng timo Edition
   Type:   video
Quality:   hd720
   Size:   18.94 MiB (19860947 Bytes)

 0 B / 18.94 MiB [--------------------------------------------------------------------------------------------]   0.00%panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x38 pc=0x626529]

goroutine 1 [running]:
github.com/iawia002/annie/utils.FileSize(0xc04220a300, 0x55, 0xc04200bfb6)
        D:/Workplace/golang/src/github.com/iawia002/annie/utils/utils.go:43 +0x59
github.com/iawia002/annie/downloader.VideoData.urlSave(0x703f18, 0x13, 0xc042044f00, 0x51, 0xc04205c390, 0x1, 0x1, 0x12f0dd3, 0x6fc2bb, 0x5, ...)
        D:/Workplace/golang/src/github.com/iawia002/annie/downloader/downloader.go:72 +0x9b
github.com/iawia002/annie/downloader.VideoData.Download(0x703f18, 0x13, 0xc042044f00, 0x51, 0xc04205c390, 0x1, 0x1, 0x12f0dd3, 0x6fc2bb, 0x5, ...)
        D:/Workplace/golang/src/github.com/iawia002/annie/downloader/downloader.go:135 +0xb17
github.com/iawia002/annie/extractors.Youtube(0xc04200a300, 0x2b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        D:/Workplace/golang/src/github.com/iawia002/annie/extractors/youtube.go:87 +0x5c7
main.main()
        D:/Workplace/golang/src/github.com/iawia002/annie/main.go:57 +0x416

问题应该出现在这个地方:https://github.com/iawia002/annie/blob/master/utils/utils.go#L52

arm64 version

Hi, i would like to propose your software as a Qnap NAS qpkg

is it possible that you propose a precompiled arm64 version ?

does the actual arm version is working on armv5, or only armv7 ?

browser extension

just one click, construct the parameters(with cookies), then open the terminal

优酷下一半出错

···root@vagrant-ubuntu-trusty-64:/data/python# ./annie_linux_amd64 http://v.youku.com/v_show/id_XMTg2MDkwMjU2OA==.html

Site: 优酷 youku.com
Title: 驴得水
Type: video
Quality: mp4hd2 1280x544
Size: 1011.24 MiB (1060363118 Bytes)

23.68 MiB / 1011.24 MiB [=>-----------------------------------------------------] 2.34% 250.36 KiB/s 1h7m18s 24.51 MiB / 1011.24 MiB [=>------------------------------------------------------] 2.42% 250.94 KiB/s 1h7m5s2018/03/23 16:08:14 Error while downloading: http://vali.cp31.ott.cibntv.net/67712A7A56F4271A343555873/0300012300584E4FFB7BBE05CF07DD5ED554FA-344E-44D9-060F-3977925FDBEC.flv?ccode=0503&duration=203&expire=18000&psid=e8c7535193b2acd84aed20dc2bb6f577&ups_client_netip=3b6c4885&ups_ts=1521793175&ups_userid=&utid=lqY7EyAiCSUCAcu7o+J2eEgs&vid=XMTg2MDkwMjU2OA%3D%3D&vkey=A8dd72981db8c7c95bbb552f14947736f&s=92d6ad9a806711e6b9bb, net/http: request canceled (Client.Timeout exceeded while reading body)
···

下载出现错误

Type: video
Quality: 高清 1080P
Size: 177.54 MiB (186162839 Bytes)

159.20 MiB / 177.54 MiB [======================================================================================>---------] 89.67% 1.59 MiB/s 10s
2018/03/18 12:40:23 Error while downloading: http://cn-jsnt-dx-v-03.acgvideo.com/vg0/c/61/34219071-2-80.flv?expires=1521354900&platform=pc&ssig=wFbUO0UouG_OrdSSKw_oew&oi=3070288114&nfa=ZGlYLwTu0dW3o1gJGPmYTQ==&dynamic=1&hfa=2023672908&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=, net/http: request canceled (Client.Timeout exceeded while reading body)**

New Design

untitled-1

Hi I have made a icon to help you in your project and to better present the program you have developed. If you want any change, you can contact me without hesitation. I hope you use it.

cannot rename the downloaded file

annie -x http://127.0.0.1:1080 https://www.youtube.com/watch?v=rVEMTxg_LrU

Site: YouTube youtube.com
Title: 一生所愛《西遊記之仙履奇緣》主题曲 片尾曲 MV HD 720p
Type: video
Quality: hd720
Size: 81.63 MiB (85595140 Bytes)

81.63 MiB / 81.63 MiB [===========================================================================] 100.00% 8.64 MiB/s2018/03/19 21:28:03 rename 一生所愛《西遊記之仙履奇緣》主题曲 片尾曲 MV HD 720p.mp4.download 一生所愛《西遊記之仙履奇緣》主题曲 片尾曲 MV HD 720p.mp4: The process cannot access the file because it is being used by another process.

maybe the encoding issue in the file name.

bilibili: request canceled

annie https://www.bilibili.com/video/av17748345

Site: 哔哩哔哩 bilibili.com
Title: 【Aimer】Aimer Live in BUDOKAN "blanc et noir" 【中日双语字幕】
Type: video
Quality: 高清 1080P
Size: 1807.59 MiB (1895391009 Bytes)

829.44 MiB / 1.77 GiB [====================================>-------------------------------------------] 45.89% 8.29 MiB/s 1m56s2018/03/21 18:23:10 Error while downloading: http://hk-hkbn7.acgvideo.com/vg7/6/de/28975875-5-80.flv?expires=1521634800&platform=pc&ssig=UqtWX_k7xdW6BizHsphstQ&oi=2946464944&nfa=ZGlYLwTu0dW3o1gJGPmYTQ==&dynamic=1&hfa=2021724512&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=806ca226c0bf4373a9ace3a79c1f11ed, net/http: request canceled (Client.Timeout exceeded while reading body)

尝试下载两次但都是在同一个地方失败。好像是链接超时, 但不知道具体原因。(啊再一次沉迷于go的并发机制,决心好好学一下。

youtube-dl

There is already youtube-dl project, which despite of the name supports multiple sites, not just YouTube.

Annie's README should provide comparison with youtube-dl or at least mention it as alternative.

Some video in bilibili.com can not download.

platform: windows 10 1709 x64
version: 0.4.1
url: https://www.bilibili.com/video/av1892780
error message:

λ annie.exe -d https://www.bilibili.com/video/av1892780

URL:         https://www.bilibili.com/video/av1892780
Method:      GET
Headers:     http.Header{
    "Accept-Encoding": {"gzip,deflate,sdch"},
    "Accept-Language": {"en-US,en;q=0.8"},
    "User-Agent":      {"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36"},
    "Referer":         {"https://www.bilibili.com/video/av1892780"},
    "Accept":          {"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},
    "Accept-Charset":  {"UTF-8,*;q=0.5"},
}
Status Code: 200

URL:         https://interface.bilibili.com/v2/playurl?appkey=84956560bc028eb7&cid=3522533&otype=json&qn=116&quality=116&type=&sign=9e72c1d0f3bc5f8183a1b22f13879118
Method:      GET
Headers:     http.Header{
    "Accept-Encoding": {"gzip,deflate,sdch"},
    "Accept-Language": {"en-US,en;q=0.8"},
    "User-Agent":      {"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36"},
    "Referer":         {"https://interface.bilibili.com/v2/playurl?appkey=84956560bc028eb7&cid=3522533&otype=json&qn=116&quality=116&type=&sign=9e72c1d0f3bc5f8183a1b22f13879118"},
    "Accept":          {"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},
    "Accept-Charset":  {"UTF-8,*;q=0.5"},
}
Status Code: 200

   Site:   哔哩哔哩 bilibili.com
  Title:   【醋醋×祈Inory】星期五的早安\(^o^) ~【生日作】 高清
   Type:   video
Quality:   高清 1080P
   Size:   50.63 MiB (53091354 Bytes)

 0 B / 50.63 MiB [--------------------------------------------------------------------------------------------]   0.00% URL:         http://cn-bj2-cc-v-09.acgvideo.com/vg1/upgcxcode/33/25/3522533/3522533-1-80.flv?expires=1521550800&platform=pc&ssig=L4vqFYouWcDAotmrx7I12g&oi=3742674228&nfa=ZGlYLwTu0dW3o1gJGPmYTQ==&dynamic=1&hfa=2021902754&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=4287ead4f1eb49d6ba51f77c54be948f
Method:      GET
Headers:     http.Header{
    "User-Agent":      {"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36"},
    "Accept":          {"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},
    "Accept-Charset":  {"UTF-8,*;q=0.5"},
    "Accept-Encoding": {"gzip,deflate,sdch"},
    "Accept-Language": {"en-US,en;q=0.8"},
    "Referer":         {"https://www.bilibili.com/video/av1892780"},
}
Status Code: 200
 0 B / 50.63 MiB [--------------------------------------------------------------------------------------------]   0.00%2018/03/20 19:03:13 Error while downloading: http://cn-bj2-cc-v-09.acgvideo.com/vg1/upgcxcode/33/25/3522533/3522533-1-80.flv?expires=1521550800&platform=pc&ssig=L4vqFYouWcDAotmrx7I12g&oi=3742674228&nfa=ZGlYLwTu0dW3o1gJGPmYTQ==&dynamic=1&hfa=2021902754&hfb=Yjk5ZmZjM2M1YzY4ZjAwYTMzMTIzYmIyNWY4ODJkNWI=&trid=4287ead4f1eb49d6ba51f77c54be948f, invalid argument

Thanks a lot~

[feature request] any plan for FreeBSD support?

Thank you for this gorgeous work, I love it.

It seems FreeBSD is not supported yet, and the darwin binary shows 'Exec format error' on FreeBSD--it works on macOS only, just as expected.

I tried annie linux-amd64 binary(v0.4.1) on FreeBSD 11.1-RELEASE-p8 with CentOS 7 compatibility layer, only to get the 'Segmentation fault' error.

I know this project is on its early stage and FreeBSD is much less popular than Linux, but if you'd like to take native FreeBSD support into consideration, I'll greatly appreciate that.

FreeBSD用的人少,但它确实是一款优秀的操作系统,发这个issue也算是给它打个广告吧 :)

download video from bilibili.com which url not end with av+id will not exit after downloading.

as the title says, tests below:

tony@tony-VirtualBox:~/下载$ 
   Site:   哔哩哔哩 bilibili.com
  Title:   【Perfume】 Music Station (2018.02.23) 无限未来
   Type:   video
Quality:   高清 720P
   Size:   52.13 MiB (54661154 Bytes)

 52.13 MiB / 52.13 MiB [============================] 100.00% 540.23 KiB/s 1m38s

[1]+  已完成               annie https://www.bilibili.com/video/av19976437?from=search

after downloading, the process will not exit, you should enter the "enter" key to exit.

extract only necessary fomats

refer #83

Only one format:

  • bcy
  • bilibili
  • douyin
  • douyu
  • pixivision
  • tumblr

Multiple formats:

  • youtube
  • facebook
  • iqiyi
  • mgtv
  • vimeo
  • youku

http://ip:port urls problem?

Running the following seem to result in an error

./annie -d http://3.18.168.212:7734/file.mp3

annie: version 0.6.3, A fast, simple and clean video downloader.

panic: runtime error: index out of range

goroutine 1 [running]:
github.com/iawia002/annie/utils.Domain(0x7ffefaa7744d, 0x13, 0xc420142180, 0x0)
	/XXXXXXX/go/src/github.com/iawia002/annie/utils/utils.go:58 +0xa3
main.main()
	/XXXXXXX/go/src/github.com/iawia002/annie/main.go:54 +0x1ca

GOOS=linux / GOARCH=amd64 / CGO_ENABLED=0 (if thats of any help)

Thanks

视频合并问题

刚开始没装FFmpeg,下了个电影,无法合并,就又去下载安装了FFmpeg,那时宿舍刚好断网,没网程序报错,不能合并已下载的视频

Youku download error

` Site: 优酷 youku.com
Title: 圆桌派 第三季:第十一集 烂片:怎样算烂?为何会烂?
Type: video
Quality: mp4hd2 1280x720
Size: 322.98 MiB (338664257 Bytes)

39.60 MiB / 322.98 MiB [===>--------------------------] 12.26% 27.53 MiB/s 1s
Merging video parts into 圆桌派 第三季:第十一集 烂片:怎样算烂?为何会烂?.mp4`

我看你用的方法和 http://www.maoyun.tv/mdparse/index.php?id=http://v.youku.com/v_show/id_XMzQ2NjUyNjYwNA==.html 是一样的,没区别,但是他能获取到正确的地址并且播放。

我建议可以从这种解析接口里获取下载地址。

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.