redfenix Posted July 21, 2013 Posted July 21, 2013 How can i get, starting from a youtube link, a 4K (quality) link? Thanks
FireFox Posted July 21, 2013 Posted July 21, 2013 Hi,What is the 4K quality?There is some examples in the forum to get youtube links.Br, FireFox.
redfenix Posted July 21, 2013 Author Posted July 21, 2013 Hi, What is the 4K quality? There is some examples in the forum to get youtube links. Br, FireFox. For example:
FireFox Posted July 21, 2013 Posted July 21, 2013 Check my YouTube Multi-Downloader (link in my signature) and try with your video link, use the correct settings and you will be able to get the Original quality link.Br, FireFox.
redfenix Posted July 21, 2013 Author Posted July 21, 2013 (edited) Check my YouTube Multi-Downloader (link in my signature) and try with your video link, use the correct settings and you will be able to get the Original quality link. Br, FireFox. I would like to write a program for download only 4K video, not use your for download vid So can you explain me only this part of video download process? (generate 4k link) Edited July 21, 2013 by redfenix
FireFox Posted July 21, 2013 Posted July 21, 2013 The source code is available, take a look at it. Between me and you, if there is already a program for it, why re-inventing the wheel?
redfenix Posted July 21, 2013 Author Posted July 21, 2013 To write it according to my taste ... Sorry but i can't understood the correct method, in your sources there are too many variables and i can't follow all your mental path (?) (sorry for my english )
FireFox Posted July 21, 2013 Posted July 21, 2013 (edited) I understand this is complex for you. I havn't looked at the code for months and it has to be updated since it's not working anymore with all links. I'm sorry but according to what I said I won't be able to help you until I have updated this last. Br, FireFox. Edited July 21, 2013 by FireFox
Solution FireFox Posted July 24, 2013 Solution Posted July 24, 2013 (edited) If you are still there, here you go :expandcollapse popup;Author: FireFox @2013 #include <String.au3> #include "WinHTTP.au3" Local $sDownload_VideoID = "kIjjHeD-0dY" Local Const $sHTTPUserAgent = "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20100101 Firefox/11.0" Local $hWinHttpOpen = _WinHttpOpen($sHTTPUserAgent) Local $hWinHttpConnect = _WinHttpConnect($hWinHttpOpen, "www.youtube.com") Local $hWinHttpRequest = _WinHttpOpenRequest($hWinHttpConnect, "GET", _ "/watch?v=" & $sDownload_VideoID, _ "HTTP/1.1") _WinHttpSendRequest($hWinHttpRequest) _WinHttpReceiveResponse($hWinHttpRequest) Local $sDownload_Chunk = "", $sDownload_ResponseData = "" While 1 $sDownload_Chunk = _WinHttpReadData($hWinHttpRequest, 1) If @error Then ExitLoop $sDownload_ResponseData &= $sDownload_Chunk WEnd _WinHttpCloseHandle($hWinHttpRequest) Local $aDownload_URLMap = _StringBetween($sDownload_ResponseData, '"url_encoded_fmt_stream_map": "', '", "') If StringInStr($aDownload_URLMap[0], '"}};') > 0 Then $aDownload_URLMap[0] = StringLeft($aDownload_URLMap[0], StringInStr($aDownload_URLMap[0], '"}};')) EndIf $aDownload_URLMap = StringSplit($aDownload_URLMap[0], ",") Local $sDownload_Link = _Download_fmtstream_GetOriginalLink($aDownload_URLMap) If $sDownload_Link = "" Then ConsoleWrite("!>Original link NOT available" & @CrLf) Exit 1 EndIf ConsoleWrite($sDownload_Link & @CrLf) ;~ ConsoleWrite("Downloading..." & @CrLf) ;~ Local $hDownload_1 = InetGet($sDownload_Link, $sDownload_VideoID & ".mp4") ;~ InetClose($hDownload_1) Func _Download_fmtstream_GetOriginalLink($aFmtstream) Local Const $sFmtOriginal = "38" Local $aParamOrder[20] = ["url", "gcr", "upn", "source", "key", "mv", "cp", "ip", "expire", "ratebypass", "mt", "itag", "sparams", "ms", "ipbits", "sver", "fexp", "id", "sig"] Local $aParam = 0, $sFmtDecoded = "" For $i = 1 To $aFmtstream[0] $aFmtstream[$i] = _UnicodeURLDecode($aFmtstream[$i]) $aParam = StringRegExp($aFmtstream[$i], "([^?&=]+)=([^?&]*)", 3) For $j = 0 To UBound($aParamOrder) - 1 For $k = 0 To UBound($aParam) - 1 Step 2 If $aParam[$k] <> $aParamOrder[$j] Then ContinueLoop If $j = 0 Then $sFmtDecoded = $aParam[$k + 1] & "?" Else If $aParam[$k] = "itag" And $aParam[$k + 1] <> $sFmtOriginal Then $sFmtDecoded = "" ExitLoop 2 ElseIf $aParam[$k] = "sig" Then $aParam[$k] = "signature" EndIf $sFmtDecoded &= $aParam[$k] & "=" & $aParam[$k + 1] & "&" EndIf ExitLoop Next Next Return StringTrimRight($sFmtDecoded, 1) Next EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _UnicodeURLDecode ; Author ........: Dhilip89 ; =============================================================================================================================== Func _UnicodeURLDecode($toDecode) Local $strChar = "", $iOne = 0, $iTwo = 0 Local $aryHex = StringSplit($toDecode, "") For $i = 1 To $aryHex[0] If $aryHex[$i] = "%" Then $i = $i + 1 $iOne = $aryHex[$i] $i = $i + 1 $iTwo = $aryHex[$i] $strChar = $strChar & Chr(Dec($iOne & $iTwo)) Else $strChar = $strChar & $aryHex[$i] EndIf Next $strChar = StringReplace($strChar, "+", " ") $strChar = StringReplace($strChar, "%3A", ":") $strChar = StringReplace($strChar, "\/", "/") $strChar = StringReplace($strChar, "\u0026", "&") Return BinaryToString(StringToBinary($strChar), 4) EndFuncBr, FireFox. Edited July 24, 2013 by FireFox
Edano Posted July 24, 2013 Posted July 24, 2013 i wonder if he means mpeg4 quality ? youtube always offers a bunch of qualities like flv or mp3 and other formats. [color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]
redfenix Posted July 24, 2013 Author Posted July 24, 2013 If you are still there, here you go : expandcollapse popup;Author: FireFox @2013 #include <String.au3> #include "WinHTTP.au3" Local $sDownload_VideoID = "kIjjHeD-0dY" Local Const $sFmtOriginal = "38" Local Const $sHTTPUserAgent = "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20100101 Firefox/11.0" Local $hWinHttpOpen = _WinHttpOpen($sHTTPUserAgent) Local $hWinHttpConnect = _WinHttpConnect($hWinHttpOpen, "www.youtube.com") Local $hWinHttpRequest = _WinHttpOpenRequest($hWinHttpConnect, "GET", _ "/watch?v=" & $sDownload_VideoID, _ "HTTP/1.1") _WinHttpSendRequest($hWinHttpRequest) _WinHttpReceiveResponse($hWinHttpRequest) Local $sDownload_Chunk = "", $sDownload_ResponseData = "" While 1 $sDownload_Chunk = _WinHttpReadData($hWinHttpRequest, 1) If @error Then ExitLoop $sDownload_ResponseData &= $sDownload_Chunk WEnd _WinHttpCloseHandle($hWinHttpRequest) Local $aDownload_URLMap = _StringBetween($sDownload_ResponseData, '"url_encoded_fmt_stream_map": "', '", "') If StringInStr($aDownload_URLMap[0], '"}};') > 0 Then $aDownload_URLMap[0] = StringLeft($aDownload_URLMap[0], StringInStr($aDownload_URLMap[0], '"}};')) EndIf $aDownload_URLMap = StringSplit($aDownload_URLMap[0], ",") Local $sDownload_Link = _Download_fmtstream_GetOriginalLink($aDownload_URLMap) If $sDownload_Link = "" Then ConsoleWrite("!>Original link NOT available" & @CrLf) Exit 1 EndIf ConsoleWrite($sDownload_Link & @CrLf) ;~ ConsoleWrite("Downloading..." & @CrLf) ;~ Local $hDownload_1 = InetGet($sDownload_Link, $sDownload_VideoID & ".mp4") ;~ InetClose($hDownload_1) Func _Download_fmtstream_GetOriginalLink($aFmtstream) Local $aParamOrder[20] = ["url", "gcr", "upn", "source", "key", "mv", "cp", "ip", "expire", "ratebypass", "mt", "itag", "sparams", "ms", "ipbits", "sver", "fexp", "id", "sig"] Local $aParam = 0, $sFmtDecoded = "" For $i = 1 To $aFmtstream[0] $aFmtstream[$i] = _UnicodeURLDecode($aFmtstream[$i]) $aParam = StringRegExp($aFmtstream[$i], "([^?&=]+)=([^?&]*)", 3) For $j = 0 To UBound($aParamOrder) - 1 For $k = 0 To UBound($aParam) - 1 Step 2 If $aParam[$k] <> $aParamOrder[$j] Then ContinueLoop If $j = 0 Then $sFmtDecoded = $aParam[$k + 1] & "?" Else If $aParam[$k] = "itag" And $aParam[$k + 1] <> $sFmtOriginal Then $sFmtDecoded = "" ExitLoop 2 ElseIf $aParam[$k] = "sig" Then $aParam[$k] = "signature" EndIf $sFmtDecoded &= $aParam[$k] & "=" & $aParam[$k + 1] & "&" EndIf ExitLoop Next Next Return StringTrimRight($sFmtDecoded, 1) Next EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _UnicodeURLDecode ; Author ........: Dhilip89 ; =============================================================================================================================== Func _UnicodeURLDecode($toDecode) Local $strChar = "", $iOne = 0, $iTwo = 0 Local $aryHex = StringSplit($toDecode, "") For $i = 1 To $aryHex[0] If $aryHex[$i] = "%" Then $i = $i + 1 $iOne = $aryHex[$i] $i = $i + 1 $iTwo = $aryHex[$i] $strChar = $strChar & Chr(Dec($iOne & $iTwo)) Else $strChar = $strChar & $aryHex[$i] EndIf Next $strChar = StringReplace($strChar, "+", " ") $strChar = StringReplace($strChar, "%3A", ":") $strChar = StringReplace($strChar, "\/", "/") $strChar = StringReplace($strChar, "\u0026", "&") Return BinaryToString(StringToBinary($strChar), 4) EndFunc Br, FireFox. *.* Epic thanks!!
Joniwe Posted October 10, 2016 Posted October 10, 2016 (edited) Copy the link form YouTube or Facebook and paste it to <snip> or <snip> program, it will be automatically downloaded to your computer. It doesn't matter what resolution you want, it can do it all. Edited October 10, 2016 by JLogan3o13
Bert Posted October 10, 2016 Posted October 10, 2016 Joniwe - you know the user posted that like 3 years ago? Please do not necropost. The Vollatran project My blog: http://www.vollysinterestingshit.com/
Moderators JLogan3o13 Posted October 10, 2016 Moderators Posted October 10, 2016 Not to mention that this kind of discussion is now prohibited, per this thread. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Recommended Posts