File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ func DownloadVideo(url string) {
223223 if end > fileLength {
224224 end = fileLength
225225 }
226- req .Header . Set ( "Range" , fmt . Sprintf ( "bytes=%d-%d" , start , end ) )
226+ req .URL . RawQuery = req . URL . Query (). Encode () + "&range=" + strconv . Itoa ( start ) + "-" + strconv . Itoa ( end )
227227 resp , err := client .Do (req )
228228 if err != nil {
229229 printErrorProps := S.PrintErrorProps {
@@ -245,7 +245,7 @@ func DownloadVideo(url string) {
245245 bar .Set (fileLength )
246246 bar .Finish ()
247247 } else {
248- req .Header . Set ( "Range" , fmt . Sprintf ( "Bytes=0-%d" , fileLength ) )
248+ req .URL . RawQuery = req . URL . Query (). Encode () + "&range=" + strconv . Itoa ( 0 ) + "-" + strconv . Itoa ( fileLength )
249249 resp , err = client .Do (req )
250250 if err != nil {
251251 printErrorProps := S.PrintErrorProps {
You can’t perform that action at this time.
0 commit comments