myYouTube Downloader.

  • Hallo , ich wollte mir ein youtube downloader basteln , hat bis jetzt auch super geklappt.
    Nur möchte ich das er die dateien mit dem Youtube namen Kennzeichnet und alle " :-,;._/()=?`´ß}][{&%$§"!°^ " entfernt weil eine datei ja keine sonderzeichen haben darf...
    aber ich komme nicht weiter. bei jedem versuch kommt immer kein name ... ich glaube ich mache alles falsch , könnt ihr mir bitte helfen?
    hier meine scripts

    "Abfrage ohne Namenssuche"
    [autoit]


    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Compression=4
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Res_SaveSource=y
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

    [/autoit] [autoit][/autoit] [autoit]

    #include <inet.au3>
    #include <string.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    ;####################### GRAPHICAL USER INTERFACE ############################################
    $Form1 = GUICreate("YouTube Video Downloader", 332, 130, 192, 124)
    $Label1 = GUICtrlCreateLabel("Vollständigen Youtube Link eingeben :", 8, 8, 186, 13)
    $dwninput = GUICtrlCreateInput("http://www.youtube.com/watch?v=XXxxXXxxXXxx", 8, 24, 249, 21)
    $download = GUICtrlCreateButton("==> Download Link Erstellen <==", 8, 48, 251, 21, $WS_GROUP)
    $Input2 = GUICtrlCreateInput("Download LINK", 8, 72, 249, 21)
    $Label2 = GUICtrlCreateLabel("Qualität =", 264, 8, 49, 17)
    $qualli = GUICtrlCreateInput("18",265,27,"50","21",$ES_CENTER)
    GUICtrlSetLimit($qualli, 2)
    $QNFO = GUICtrlCreateButton("Info",265,50,50,21)
    $DLDL = GUICtrlCreateLabel("<= Copy",265,76,50,21)
    $Status = GUICtrlCreateLabel("percent",265,99,999,21)
    $Progress1 = GUICtrlCreateProgress(8, 96, 250, 17)
    GUISetState(@SW_SHOW)
    ;####################### GRAPHICAL USER INTERFACE ############################################

    [/autoit] [autoit][/autoit] [autoit]

    $Percent = 0
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    case $QNFO
    MsgBox(64,"QNFO","Die Quallität wird in zahlen eingegeben"&@CRLF&"LD = 17"&@CRLF&"HQ = 18"&@CRLF&"HD = 22")
    Case $download
    GUICtrlSetState($download ,$GUI_DISABLE)
    $Video_Q = GUICtrlRead($Qualli)
    $dwnlink = GUICtrlRead($dwninput)
    $sCode = _INetGetSource($dwnlink)
    $token = StringRegExp($sCode, "&t=(.*?)&", 3)
    If Not IsArray($token) Then
    MsgBox(0, "Error", "Ungültiger Link!")
    Else
    $value = StringMid($dwnlink, StringInStr($dwnlink, "v=") + 2)
    GUICtrlSetData($Input2,"http://youtube.com/get_video?video_id=" & $value & "&t=" & $token[0]& "&fmt="&$Video_Q)
    EndIf
    $Antwort = InputBox("Antwort","möchten sie dieses Video downloaden? ja/nein","ja")
    if $Antwort = "ja" Then
    $link = GUICtrlRead($Input2)
    $name = ".mp4"
    $load = InetGet($link,$name,1,1)
    Do
    $filesize = InetGetInfo($load, 1)
    Sleep(100)
    GUICtrlSetData($Progress1,(InetGetInfo($load, 0)/$filesize)*100)
    $Percent = Round((InetGetInfo($load,0)/$filesize)*100,0)
    GUICtrlSetData($Status,$Percent & "% loaded")
    Until InetGetInfo($load, 2)
    GUICtrlSetData($Status, "Finish")
    EndIf
    GUICtrlSetState($download ,$GUI_ENABLE)
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    WEnd

    [/autoit]
    &quot;Ohne Abfrage mit namenssuche&quot;
    [autoit]


    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Compression=4
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Res_SaveSource=y
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

    [/autoit] [autoit][/autoit] [autoit]

    #include <inet.au3>
    #include <string.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    ;####################### GRAPHICAL USER INTERFACE ############################################
    $Form1 = GUICreate("YouTube Video Downloader", 332, 95, 192, 124)
    $Label1 = GUICtrlCreateLabel("Vollständigen Youtube Link eingeben :", 8, 8, 186, 13)
    $dwninput = GUICtrlCreateInput("http://www.youtube.com/watch?v=XXxxXXxxXXxx", 8, 24, 249, 21)
    $download = GUICtrlCreateButton("==> Download Link Erstellen <==", 8, 48, 251, 21, $WS_GROUP)
    $Input2 = GUICtrlCreateInput("Download LINK", 8, 96, 249, 21)
    $Text = GUICtrlCreateInput("its here", 8, 200, 249, 21)
    $Label2 = GUICtrlCreateLabel("Qualität =", 266, 8, 49, 17)
    $qualli = GUICtrlCreateInput("18",265,27,"50","21",$ES_CENTER)
    GUICtrlSetLimit($qualli, 2)
    $QNFO = GUICtrlCreateButton("Info",265,50,50,21)
    $DLDL = GUICtrlCreateLabel("<= Copy",265,99,50,21)
    $Status = GUICtrlCreateLabel("percent",265,76,999,21)
    $Progress1 = GUICtrlCreateProgress(8, 72, 250, 17)
    GUISetState(@SW_SHOW)
    ;####################### GRAPHICAL USER INTERFACE ############################################

    [/autoit] [autoit][/autoit] [autoit]

    $Percent = 0
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    case $QNFO
    MsgBox(64,"QNFO","Die Quallität wird in zahlen eingegeben"&@CRLF&"LD = 17"&@CRLF&"HQ = 18"&@CRLF&"HD = 22")
    Case $download
    GUICtrlSetState($download ,$GUI_DISABLE)
    $Video_Q = GUICtrlRead($Qualli)
    $dwnlink = GUICtrlRead($dwninput)
    $sCode = _INetGetSource($dwnlink)
    $Text2 = GUICtrlRead($Text)
    $Link = GUICtrlRead($Input2)
    $token = StringRegExp($sCode, "&t=(.*?)&", 3)
    If Not IsArray($token) Then
    MsgBox(0, "Error", "Ungültiger Link!")
    Else
    $value = StringMid($dwnlink, StringInStr($dwnlink, "v=") + 2)
    GUICtrlSetData($Input2,"http://youtube.com/get_video?video_id=" & $value & "&t=" & $token[0]& "&fmt="&$Video_Q)

    [/autoit] [autoit][/autoit] [autoit]

    $source = _INetGetSource($dwnlink)
    $array = _StringBetween($source, '<title>', '</title>')
    $videoname = StringTrimLeft($array[0], 17)
    $newname = StringReplace($videoname,":"," ")
    GUICtrlSetData($Text2,$newname)
    MsgBox("","",$Text2)
    $dateiname = $Text2&".mp4"
    $load = InetGet($link,$dateiname,1,1)
    Do
    $filesize = InetGetInfo($load, 1)
    Sleep(100)
    GUICtrlSetData($Progress1,(InetGetInfo($load, 0)/$filesize)*100)
    $Percent = Round((InetGetInfo($load,0)/$filesize)*100,0)
    GUICtrlSetData($Status,$Percent & "% loaded")
    Until InetGetInfo($load, 2)
    GUICtrlSetData($Status, "Finish")
    MsgBox(0, "", StringTrimLeft($array[0], 17)&@CRLF&"wurde fertig gedownloaded")
    GUICtrlSetState($download ,$GUI_ENABLE)
    EndIf
    EndSwitch
    WEnd

    [/autoit]
    [autoit]


    #cs-----------------------------------------------------------------------------
    Hilfe ist immer gut also nimmt sie an ^^
    #ce-----------------------------------------------------------------------------

    [/autoit]
  • eigentlich wollte ich es alleine mit etwas hilfe machen...
    aber so wäre ein link ganz schön nett

    [autoit]


    #cs-----------------------------------------------------------------------------
    Hilfe ist immer gut also nimmt sie an ^^
    #ce-----------------------------------------------------------------------------

    [/autoit]