Youtube Mp3 Downloader

Programlama dilleri konusunda bilgi paylaşım alanıdır.
Cevapla
darendeli
Byte3
Byte3
Mesajlar: 147
Kayıt: 06 Haz 2016, 16:55

Youtube Mp3 Downloader

Mesaj gönderen darendeli » 16 Oca 2018, 00:32

1 Kac tane Sarkıyı Aynı Anda İndirmek Yani Linki Yapıstırdım iniyor O inerken Diger Linki Yapıstırıp indirmek istiyorum mümkünmü
Mümkünse Sarkının Adını Progresini Ve İndirilme Yüzdesiyle Liste Yada Listviewde Gösterebilirmiyiz..

Kod: Tümünü seç

#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <ComboConstants.au3>
#include <File.au3>
#include "_UskinLibrary.au3"

_LoadGUI()
If @OSVersion > "WIN_VISTA" Then Exit MsgBox(16, "Bilgi", "Malesef İşletim Sisteminiz Bu Programı Desteklemiyor..")
If UBound(ProcessList(@ScriptName)) > 2 Then
Opt("TrayMenuMode", 1)
TraySetState(1)
TrayTip("Youtube Mp3 Downloader V2", "Zaten Çalışıyorum...", 10, 4)
Sleep(10000)
Exit
EndIf
Global $__IELoadWaitTimeout = 300000
Global $__IEAU3Debug = False
Global $_IEErrorNotify = True
Global Const $IEAU3VersionInfo[6] = ["T", 3, 0, 1, "20130601", "T3.0-1"]
Global Enum $_IEStatus_Success = 0, $_IEStatus_GeneralError, $_IEStatus_ComError, $_IEStatus_InvalidDataType, $_IEStatus_InvalidObjectType, $_IEStatus_InvalidValue, $_IEStatus_LoadWaitTimeout, $_IEStatus_NoMatch, $_IEStatus_AccessIsDenied, $_IEStatus_ClientDisconnected
Func _IELoadWait(ByRef $o_object, $i_delay = 0, $i_timeout = -1)
If Not IsObj($o_object) Then
__IEConsoleWriteError("Error", "_IELoadWait", "$_IEStatus_InvalidDataType")
Return SetError($_IEStatus_InvalidDataType, 1, 0)
EndIf
If Not __IEIsObjType($o_object, "browserdom") Then
__IEConsoleWriteError("Error", "_IELoadWait", "$_IEStatus_InvalidObjectType", ObjName($o_object))
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
Local $oTemp, $f_Abort = False, $i_ErrorStatusCode = $_IEStatus_Success
Local $f_NotifyStatus = _IEErrorNotify()
_IEErrorNotify(False)
Sleep($i_delay)
Local $i_error
Local $IELoadWaitTimer = TimerInit()
If $i_timeout = -1 Then $i_timeout = $__IELoadWaitTimeout
Select
Case __IEIsObjType($o_object, "browser")
While Not(String($o_object.readyState) = "complete" Or $o_object.readyState = 4 Or $f_Abort)
If @error Then
$i_error = @error
If __IEComErrorUnrecoverable($i_error) Then
$i_ErrorStatusCode = __IEComErrorUnrecoverable($i_error)
$f_Abort = True
EndIf
ElseIf(TimerDiff($IELoadWaitTimer) > $i_timeout) Then
$i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout
$f_Abort = True
EndIf
Sleep(100)
WEnd
While Not(String($o_object.document.readyState) = "complete" Or $o_object.document.readyState = 4 Or $f_Abort)
If @error Then
$i_error = @error
If __IEComErrorUnrecoverable($i_error) Then
$i_ErrorStatusCode = __IEComErrorUnrecoverable($i_error)
$f_Abort = True
EndIf
ElseIf(TimerDiff($IELoadWaitTimer) > $i_timeout) Then
$i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout
$f_Abort = True
EndIf
Sleep(100)
WEnd
Case __IEIsObjType($o_object, "window")
While Not(String($o_object.document.readyState) = "complete" Or $o_object.document.readyState = 4 Or $f_Abort)
If @error Then
$i_error = @error
If __IEComErrorUnrecoverable($i_error) Then
$i_ErrorStatusCode = __IEComErrorUnrecoverable($i_error)
$f_Abort = True
EndIf
ElseIf(TimerDiff($IELoadWaitTimer) > $i_timeout) Then
$i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout
$f_Abort = True
EndIf
Sleep(100)
WEnd
While Not(String($o_object.top.document.readyState) = "complete" Or $o_object.top.document.readyState = 4 Or $f_Abort)
If @error Then
$i_error = @error
If __IEComErrorUnrecoverable($i_error) Then
$i_ErrorStatusCode = __IEComErrorUnrecoverable($i_error)
$f_Abort = True
EndIf
ElseIf(TimerDiff($IELoadWaitTimer) > $i_timeout) Then
$i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout
$f_Abort = True
EndIf
Sleep(100)
WEnd
Case __IEIsObjType($o_object, "document")
$oTemp = $o_object.parentWindow
While Not(String($oTemp.document.readyState) = "complete" Or $oTemp.document.readyState = 4 Or $f_Abort)
If @error Then
$i_error = @error
If __IEComErrorUnrecoverable($i_error) Then
$i_ErrorStatusCode = __IEComErrorUnrecoverable($i_error)
$f_Abort = True
EndIf
ElseIf(TimerDiff($IELoadWaitTimer) > $i_timeout) Then
$i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout
$f_Abort = True
EndIf
Sleep(100)
WEnd
While Not(String($oTemp.top.document.readyState) = "complete" Or $oTemp.top.document.readyState = 4 Or $f_Abort)
If @error Then
$i_error = @error
If __IEComErrorUnrecoverable($i_error) Then
$i_ErrorStatusCode = __IEComErrorUnrecoverable($i_error)
$f_Abort = True
EndIf
ElseIf(TimerDiff($IELoadWaitTimer) > $i_timeout) Then
$i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout
$f_Abort = True
EndIf
Sleep(100)
WEnd
Case Else
$oTemp = $o_object.document.parentWindow
While Not(String($oTemp.document.readyState) = "complete" Or $oTemp.document.readyState = 4 Or $f_Abort)
If @error Then
$i_error = @error
If __IEComErrorUnrecoverable($i_error) Then
$i_ErrorStatusCode = __IEComErrorUnrecoverable($i_error)
$f_Abort = True
EndIf
ElseIf(TimerDiff($IELoadWaitTimer) > $i_timeout) Then
$i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout
$f_Abort = True
EndIf
Sleep(100)
WEnd
While Not(String($oTemp.top.document.readyState) = "complete" Or $o_object.top.document.readyState = 4 Or $f_Abort)
If @error Then
$i_error = @error
If __IEComErrorUnrecoverable($i_error) Then
$i_ErrorStatusCode = __IEComErrorUnrecoverable($i_error)
$f_Abort = True
EndIf
ElseIf(TimerDiff($IELoadWaitTimer) > $i_timeout) Then
$i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout
$f_Abort = True
EndIf
Sleep(100)
WEnd
EndSelect
_IEErrorNotify($f_NotifyStatus)
Switch $i_ErrorStatusCode
Case $_IEStatus_Success
Return SetError($_IEStatus_Success, 0, 1)
Case $_IEStatus_LoadWaitTimeout
__IEConsoleWriteError("Warning", "_IELoadWait", "$_IEStatus_LoadWaitTimeout")
Return SetError($_IEStatus_LoadWaitTimeout, 3, 0)
Case $_IEStatus_AccessIsDenied
__IEConsoleWriteError("Warning", "_IELoadWait", "$_IEStatus_AccessIsDenied", "Cannot verify readyState.  Likely casue: cross-domain scripting security restriction. (" & $i_error & ")")
Return SetError($_IEStatus_AccessIsDenied, 0, 0)
Case $_IEStatus_ClientDisconnected
__IEConsoleWriteError("Error", "_IELoadWait", "$_IEStatus_ClientDisconnected", $i_error & ", Browser has been deleted prior to operation.")
Return SetError($_IEStatus_ClientDisconnected, 0, 0)
Case Else
__IEConsoleWriteError("Error", "_IELoadWait", "$_IEStatus_GeneralError", "Invalid Error Status - Notify IE.au3 developer")
Return SetError($_IEStatus_GeneralError, 0, 0)
EndSwitch
EndFunc
Func _IEFormElementSetValue(ByRef $o_object, $s_newvalue, $f_fireEvent = 1)
If Not IsObj($o_object) Then
__IEConsoleWriteError("Error", "_IEFormElementSetValue", "$_IEStatus_InvalidDataType")
Return SetError($_IEStatus_InvalidDataType, 1, 0)
EndIf
If Not __IEIsObjType($o_object, "forminputelement") Then
__IEConsoleWriteError("Error", "_IEFormElementSetValue", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
If String($o_object.type) = "file" Then
__IEConsoleWriteError("Error", "_IEFormElementSetValue", "$_IEStatus_InvalidObjectType", "Browser securuty prevents SetValue of TYPE=FILE")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.value = $s_newvalue
If @error Then
__IEConsoleWriteError("Error", "_IEFormElementSetValue", "$_IEStatus_COMError", @error)
Return SetError($_IEStatus_ComError, @error, 0)
EndIf
If $f_fireEvent Then
$o_object.fireEvent("OnChange")
$o_object.fireEvent("OnClick")
EndIf
Return SetError($_IEStatus_Success, 0, 1)
EndFunc
Func _IEBodyReadHTML(ByRef $o_object)
If Not IsObj($o_object) Then
__IEConsoleWriteError("Error", "_IEBodyReadHTML", "$_IEStatus_InvalidDataType")
Return SetError($_IEStatus_InvalidDataType, 1, 0)
EndIf
Return SetError($_IEStatus_Success, 0, $o_object.document.body.innerHTML)
EndFunc
Func _IEGetObjById(ByRef $o_object, $s_Id)
If Not IsObj($o_object) Then
__IEConsoleWriteError("Error", "_IEGetObjById", "$_IEStatus_InvalidDataType")
Return SetError($_IEStatus_InvalidDataType, 1, 0)
EndIf
If Not __IEIsObjType($o_object, "browserdom") Then
__IEConsoleWriteError("Error", "_IEGetObById", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
If IsObj($o_object.document.getElementById($s_Id)) Then
Return SetError($_IEStatus_Success, 0, $o_object.document.getElementById($s_Id))
Else
__IEConsoleWriteError("Warning", "_IEGetObjById", "$_IEStatus_NoMatch", $s_Id)
Return SetError($_IEStatus_NoMatch, 2, 0)
EndIf
EndFunc
Func _IEAction(ByRef $o_object, $s_action)
If Not IsObj($o_object) Then
__IEConsoleWriteError("Error", "_IEAction(" & $s_action & ")", "$_IEStatus_InvalidDataType")
Return SetError($_IEStatus_InvalidDataType, 1, 0)
EndIf
$s_action = StringLower($s_action)
Select
Case $s_action = "click"
If __IEIsObjType($o_object, "documentContainer") Then
__IEConsoleWriteError("Error", "_IEAction(click)", " $_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.Click()
Case $s_action = "disable"
If __IEIsObjType($o_object, "documentContainer") Then
__IEConsoleWriteError("Error", "_IEAction(disable)", " $_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.disabled = True
Case $s_action = "enable"
If __IEIsObjType($o_object, "documentContainer") Then
__IEConsoleWriteError("Error", "_IEAction(enable)", " $_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.disabled = False
Case $s_action = "focus"
If __IEIsObjType($o_object, "documentContainer") Then
__IEConsoleWriteError("Error", "_IEAction(focus)", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.Focus()
Case $s_action = "scrollintoview"
If __IEIsObjType($o_object, "documentContainer") Then
__IEConsoleWriteError("Error", "_IEAction(scrollintoview)", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.scrollIntoView()
Case $s_action = "copy"
$o_object.document.execCommand("Copy")
Case $s_action = "cut"
$o_object.document.execCommand("Cut")
Case $s_action = "paste"
$o_object.document.execCommand("Paste")
Case $s_action = "delete"
$o_object.document.execCommand("Delete")
Case $s_action = "saveas"
$o_object.document.execCommand("SaveAs")
Case $s_action = "refresh"
$o_object.document.execCommand("Refresh")
If @error Then
__IEConsoleWriteError("Error", "_IEAction(refresh)", "$_IEStatus_COMError", @error)
Return SetError($_IEStatus_ComError, @error, 0)
EndIf
_IELoadWait($o_object)
Case $s_action = "selectall"
$o_object.document.execCommand("SelectAll")
Case $s_action = "unselect"
$o_object.document.execCommand("Unselect")
Case $s_action = "print"
$o_object.document.parentwindow.Print()
Case $s_action = "printdefault"
If Not __IEIsObjType($o_object, "browser") Then
__IEConsoleWriteError("Error", "_IEAction(printdefault)", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.execWB(6, 2)
Case $s_action = "back"
If Not __IEIsObjType($o_object, "documentContainer") Then
__IEConsoleWriteError("Error", "_IEAction(back)", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.GoBack()
Case $s_action = "blur"
$o_object.Blur()
Case $s_action = "forward"
If Not __IEIsObjType($o_object, "documentContainer") Then
__IEConsoleWriteError("Error", "_IEAction(forward)", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.GoForward()
Case $s_action = "home"
If Not __IEIsObjType($o_object, "documentContainer") Then
__IEConsoleWriteError("Error", "_IEAction(home)", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.GoHome()
Case $s_action = "invisible"
If Not __IEIsObjType($o_object, "browser") Then
__IEConsoleWriteError("Error", "_IEAction(invisible)", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.visible = 0
Case $s_action = "visible"
If Not __IEIsObjType($o_object, "browser") Then
__IEConsoleWriteError("Error", "_IEAction(visible)", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.visible = 1
Case $s_action = "search"
If Not __IEIsObjType($o_object, "browser") Then
__IEConsoleWriteError("Error", "_IEAction(search)", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.GoSearch()
Case $s_action = "stop"
If Not __IEIsObjType($o_object, "documentContainer") Then
__IEConsoleWriteError("Error", "_IEAction(stop)", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.Stop()
Case $s_action = "quit"
If Not __IEIsObjType($o_object, "browser") Then
__IEConsoleWriteError("Error", "_IEAction(quit)", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
$o_object.Quit()
If @error Then
__IEConsoleWriteError("Error", "_IEAction(" & $s_action & ")", "$_IEStatus_COMError", @error)
Return SetError($_IEStatus_ComError, @error, 0)
EndIf
$o_object = 0
Return SetError($_IEStatus_Success, 0, 1)
Case Else
__IEConsoleWriteError("Error", "_IEAction(" & $s_action & ")", "$_IEStatus_InvalidValue", "Invalid Action")
Return SetError($_IEStatus_InvalidValue, 2, 0)
EndSelect
If @error Then
__IEConsoleWriteError("Error", "_IEAction(" & $s_action & ")", "$_IEStatus_COMError", @error)
Return SetError($_IEStatus_ComError, @error, 0)
EndIf
Return SetError($_IEStatus_Success, 0, 1)
EndFunc
Func _IEErrorNotify($f_notify = Default)
If $f_notify = Default Then Return $_IEErrorNotify
If $f_notify Then
$_IEErrorNotify = True
Else
$_IEErrorNotify = False
EndIf
Return 1
EndFunc
Func __IEIsObjType(ByRef $o_object, $s_type)
If Not IsObj($o_object) Then
Return SetError($_IEStatus_InvalidDataType, 1, 0)
EndIf
Local $f_NotifyStatus = _IEErrorNotify()
_IEErrorNotify(False)
Local $s_name = String(ObjName($o_object)), $ErrorStatus = $_IEStatus_InvalidObjectType
Switch $s_type
Case "browserdom"
If __IEIsObjType($o_object, "documentcontainer") Then
$ErrorStatus = $_IEStatus_Success
ElseIf __IEIsObjType($o_object, "document") Then
$ErrorStatus = $_IEStatus_Success
Else
Local $oTemp = $o_object.document
If __IEIsObjType($oTemp, "document") Then
$ErrorStatus = $_IEStatus_Success
EndIf
EndIf
Case "browser"
If($s_name = "IWebBrowser2") Or($s_name = "IWebBrowser") Or($s_name = "WebBrowser") Then $ErrorStatus = $_IEStatus_Success
Case "window"
If $s_name = "HTMLWindow2" Then $ErrorStatus = $_IEStatus_Success
Case "documentContainer"
If __IEIsObjType($o_object, "window") Or __IEIsObjType($o_object, "browser") Then $ErrorStatus = $_IEStatus_Success
Case "document"
If $s_name = "HTMLDocument" Then $ErrorStatus = $_IEStatus_Success
Case "table"
If $s_name = "HTMLTable" Then $ErrorStatus = $_IEStatus_Success
Case "form"
If $s_name = "HTMLFormElement" Then $ErrorStatus = $_IEStatus_Success
Case "forminputelement"
If($s_name = "HTMLInputElement") Or($s_name = "HTMLSelectElement") Or($s_name = "HTMLTextAreaElement") Then $ErrorStatus = $_IEStatus_Success
Case "elementcollection"
If($s_name = "HTMLElementCollection") Then $ErrorStatus = $_IEStatus_Success
Case "formselectelement"
If $s_name = "HTMLSelectElement" Then $ErrorStatus = $_IEStatus_Success
Case Else
$ErrorStatus = $_IEStatus_InvalidValue
EndSwitch
_IEErrorNotify($f_NotifyStatus)
If $ErrorStatus = $_IEStatus_Success Then
Return SetError($_IEStatus_Success, 0, 1)
Else
Return SetError($ErrorStatus, 1, 0)
EndIf
EndFunc
Func __IEConsoleWriteError($s_severity, $s_func, $s_message = Default, $s_status = Default)
If $_IEErrorNotify Or $__IEAU3Debug Then
Local $sStr = "--> IE.au3 " & $IEAU3VersionInfo[5] & " " & $s_severity & " from function " & $s_func
If Not($s_message = Default) Then $sStr &= ", " & $s_message
If Not($s_status = Default) Then $sStr &= " (" & $s_status & ")"
ConsoleWrite($sStr & @CRLF)
EndIf
Return SetError($s_status, 0, 1)
EndFunc
Func __IEComErrorUnrecoverable($i_error)
Switch $i_error
Case -2147352567
Return $_IEStatus_AccessIsDenied
Case -2147024891
Return $_IEStatus_AccessIsDenied
Case -2147417848
Return $_IEStatus_ClientDisconnected
Case -2147023174
Return $_IEStatus_ClientDisconnected
Case -2147023179
Return $_IEStatus_ClientDisconnected
Case Else
Return $_IEStatus_Success
EndSwitch
EndFunc

Global Const $tagRECT = "struct;long Left;long Top;long Right;long Bottom;endstruct"
Global Const $tagREBARBANDINFO = "uint cbSize;uint fMask;uint fStyle;dword clrFore;dword clrBack;ptr lpText;uint cch;" & "int iImage;hwnd hwndChild;uint cxMinChild;uint cyMinChild;uint cx;handle hbmBack;uint wID;uint cyChild;uint cyMaxChild;" & "uint cyIntegral;uint cxIdeal;lparam lParam;uint cxHeader" &((@OSVersion = "WIN_XP") ? "" : ";" & $tagRECT & ";uint uChevronState")
Global Const $tagOSVERSIONINFO = 'struct;dword OSVersionInfoSize;dword MajorVersion;dword MinorVersion;dword BuildNumber;dword PlatformId;wchar CSDVersion[128];endstruct'
Global Const $__WINVER = __WINVER()
Func _WinAPI_PathIsDirectory($sPath)
Local $Ret = DllCall('shlwapi.dll', 'bool', 'PathIsDirectoryW', 'wstr', $sPath)
If @error Then Return SetError(@error, @extended, False)
Return $Ret[0]
EndFunc
Func __CheckErrorArrayBounds(Const ByRef $aData, ByRef $iStart, ByRef $iEnd, $nDim = 1, $iDim = 0)
If Not IsArray($aData) Then Return SetError(1, 0, 1)
If UBound($aData, $iDim) <> $nDim Then Return SetError(2, 0, 1)
If $iStart < 0 Then $iStart = 0
Local $iUBound = UBound($aData) - 1
If $iEnd < 1 Or $iEnd > $iUBound Then $iEnd = $iUBound
If $iStart > $iEnd Then Return SetError(4, 0, 1)
Return 0
EndFunc
Func __WINVER()
Local $tOSVI = DllStructCreate($tagOSVERSIONINFO)
DllStructSetData($tOSVI, 1, DllStructGetSize($tOSVI))
Local $Ret = DllCall('kernel32.dll', 'bool', 'GetVersionExW', 'struct*', $tOSVI)
If @error Or Not $Ret[0] Then Return SetError(@error, @extended, 0)
Return BitOR(BitShift(DllStructGetData($tOSVI, 2), -8), DllStructGetData($tOSVI, 3))
EndFunc
Func _WinAPI_CoInitialize($iFlags = 0)
Local $Ret = DllCall('ole32.dll', 'long', 'CoInitializeEx', 'ptr', 0, 'dword', $iFlags)
If @error Then Return SetError(@error, @extended, 0)
If $Ret[0] Then Return SetError(10, $Ret[0], 0)
Return 1
EndFunc
Func _WinAPI_CoTaskMemFree($pMemory)
DllCall('ole32.dll', 'none', 'CoTaskMemFree', 'ptr', $pMemory)
If @error Then Return SetError(@error, @extended, 0)
Return 1
EndFunc
Func _WinAPI_CoUninitialize()
DllCall('ole32.dll', 'none', 'CoUninitialize')
If @error Then Return SetError(@error, @extended, 0)
Return 1
EndFunc
Func _WinAPI_PathRemoveBackslash($sPath)
Local $Ret = DllCall('shlwapi.dll', 'ptr', 'PathRemoveBackslashW', 'wstr', $sPath)
If @error Then Return SetError(@error, @extended, '')
Return $Ret[1]
EndFunc
Func _WinAPI_PathSearchAndQualify($sPath, $fExists = 0)
Local $Ret = DllCall('shlwapi.dll', 'bool', 'PathSearchAndQualifyW', 'wstr', $sPath, 'wstr', '', 'int', 4096)
If @error Or Not $Ret[0] Then Return SetError(@error + 10, @extended, '')
If $fExists And Not FileExists($Ret[2]) Then Return SetError(20, 0, '')
Return $Ret[2]
EndFunc
Func _WinAPI_ShellILCreateFromPath($sPath)
Local $Ret = DllCall('shell32.dll', 'long', 'SHILCreateFromPath', 'wstr', $sPath, 'ptr*', 0, 'dword*', 0)
If @error Then Return SetError(@error, @extended, 0)
If $Ret[0] Then Return SetError(10, $Ret[0], 0)
Return $Ret[2]
EndFunc
Func _WinAPI_ShellOpenFolderAndSelectItems($sPath, $aNames = 0, $iStart = 0, $iEnd = -1, $iFlags = 0)
Local $PIDL, $Ret, $tPtr = 0, $Count = 0, $Obj = 0, $Error = 0
$sPath = _WinAPI_PathRemoveBackslash(_WinAPI_PathSearchAndQualify($sPath))
If IsArray($aNames) Then
If $sPath And Not _WinAPI_PathIsDirectory($sPath) Then Return SetError(@error + 20, @extended, 0)
EndIf
$PIDL = _WinAPI_ShellILCreateFromPath($sPath)
If @error Then Return SetError(@error + 30, @extended, 0)
If Not __CheckErrorArrayBounds($aNames, $iStart, $iEnd) Then
$tPtr = DllStructCreate('ptr[' &($iEnd - $iStart + 1) & ']')
For $i = $iStart To $iEnd
$Count += 1
If $aNames[$i] Then
DllStructSetData($tPtr, 1, _WinAPI_ShellILCreateFromPath($sPath & '\' & $aNames[$i]), $Count)
Else
DllStructSetData($tPtr, 1, 0, $Count)
EndIf
Next
EndIf
If _WinAPI_CoInitialize() Then $Obj = 1
$Ret = DllCall('shell32.dll', 'long', 'SHOpenFolderAndSelectItems', 'ptr', $PIDL, 'uint', $Count, 'struct*', $tPtr, 'dword', $iFlags)
If @error Then
$Error = @error + 10
Else
If $Ret[0] Then $Error = 10
EndIf
If $Obj Then _WinAPI_CoUninitialize()
_WinAPI_CoTaskMemFree($PIDL)
For $i = 1 To $Count
$PIDL = DllStructGetData($tPtr, $i)
If $PIDL Then
_WinAPI_CoTaskMemFree($PIDL)
EndIf
Next
If $Error = 10 Then Return SetError(10, $Ret[0], 0)
If $Error Then Return SetError($Error, 0, 0)
Return 1
EndFunc

_ReduceMemory()
AdlibRegister("_ReduceMemory", 6000)






Func _LoadGUI()
Local $ThemeList = _LoadThemeList()
_LoadTheme($ThemeList[1])
Global $hGUI = GUICreate("Youtube MP3 Downloader V2", 562, 388)
GUICtrlCreateLabel("", 129, 0, 315, 105)
GUICtrlSetBkColor(-1, 0xFFFFA8)
Global $iLabel = GUICtrlCreateLabel("0 MB / 0 MB" & @LF & "İndirme Hızı : 0 KB/s", 450, 145, 122, 50)
Global $iStartClose = GUICtrlCreateButton("İndir", 450, 110, 90, 30)
GUICtrlSetFont(-1, 10, 600)
Global $iInput = GUICtrlCreateInput("Buraya Linki Yapıştırarak Başlıyabilirsiniz..", 8, 112, 433, 21)
Global $iProgressBar = GUICtrlCreateProgress(8, 144, 433, 25)
Global $Label2 = GUICtrlCreateLabel("  Youtube MP3 Downloader'a Hoş Geldiniz!", 129, 37, 315, 60)
GUICtrlSetFont(-1, 12, 549)
GUICtrlSetColor(-1, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFA8)
$hListBox = GUICtrlCreateListView("Şarkının Adı                               |      Progress                      |                    İndirilme ", 8, 186, 545, 213)
GUICtrlSetFont(-1, 11, 600)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetTip(-1, "Hazırlayan..", "Yazan : ", 1)
GUICtrlSetCursor(-1, 0)
GUICtrlCreatePic(@TempDir & "\youtube.jpg", 0, 0, 129, 105)
Global $Checkbox1 = GUICtrlCreateCheckbox("Otomatik Algılama", 448, 56, 113, 41)
WinSetTrans($hGUI, "", 0)
GUICtrlCreateLabel("Tema seçiniz", 458, 10, 100, 25)
Global $Combo1 = GUICtrlCreateCombo("",452, 30, 100, 25,$CBS_DROPDOWNLIST)
GUICtrlSetData($Combo1, $ThemeList[0],$ThemeList[1])
GUISetState()
GUISetState(@SW_DISABLE)
For $i = 1 To 255
WinSetTrans($hGUI, "", $i)
Sleep(10)
Next
GUISetState(@SW_ENABLE)
EndFunc


Func _LoadThemeList()
	Local $aThemes = _FileListToArray(@ScriptDir & "\Temalar", "*.msstyles")
	Local $ThemeExt = ".msstyles"
	Local $tExtLen = StringLen($ThemeExt)
	Local $sComboData[2] = ['',RegRead("HKEY_CURRENT_USER\Software\MyProgram","MyTheme")]

	If IsArray($aThemes) Then
		For $i = 1 To $aThemes[0]
			$aThemes[$i] = StringTrimRight($aThemes[$i],$tExtLen)
			$sComboData[0] &= $aThemes[$i] & "|"
			If StringLen($sComboData[1]) = 0 Then $sComboData[1] = $aThemes[$i]
		Next
		If StringInStr("|" & $sComboData[0],"|" & $sComboData[1] & "|") = 0 THen $sComboData[1] = $aThemes[1]
	EndIf
	Return $sComboData
EndFunc



Func _SwitchTheme($sTheme)
	GUIDelete($hGUI)
	_USkin_Exit()
	_LoadTheme($sTheme)
	_LoadGUI()
EndFunc

Func _LoadTheme($sTheme)
	If StringLen($sTheme) = 0 Then Return 0
	_Uskin_LoadDLL()
	_USkin_Init(@ScriptDir & "\Temalar\" & $sTheme & ".msstyles")
	RegWrite("HKEY_CURRENT_USER\Software\MyProgram","MyTheme", "REG_SZ", $sTheme)
EndFunc


Global $sFilePath = '', $sFilePathURL, $iFileSize, $replace, $name, $html, $name, $exp, $history
$history = "www.youtube.com/watch?v="
If Ping("www.google.com", 1000) Then
AdlibRegister("copy", 1000)
GUICtrlSetState($Checkbox1, 1)
EndIf

_ReduceMemory()
While 1
Switch GUIGetMsg()
Case -3
GUISetState(@SW_DISABLE)
For $i = 255 To 1 Step -2
WinSetTrans($hGUI, "", $i)
Sleep(10)
Next
Exit
Case $iStartClose
If Ping("www.google.com", 1000) Then
If StringInStr(GUICtrlRead($iInput), "www.youtube.com/watch?v=") And GUICtrlRead($iInput) <> $history Then
GUICtrlSetData($Label2, " Şarkı Hazırlanıyor Lütfen Bekleyiniz...")
$name = _iestart(GUICtrlRead($iInput))
If $name <> "error" Then
$sFilePathURL = $exp
GUICtrlSetData($Label2, "  " & $name)
_image(GUICtrlRead($iInput))
$sFilePath = _InetGetGUI($sFilePathURL, $iLabel, $iProgressBar, $iStartClose, @ScriptDir & "\" & $name)
_switch()
EndIf
Else
MsgBox(48, "Bilgi", "Yazmış Olduğunuz Link Yanlış. Lütfen Kontrol Ediniz..")
WinActivate($hGUI)
EndIf
Else
MsgBox(48, "Bilgi", "İnternet Bağlantınız Yok ! Lütfen Kontrol Edin..")
WinActivate($hGUI)
EndIf
Case $Checkbox1
If GUICtrlRead($Checkbox1) = 1 Then
If Ping("www.google.com", 1000) Then
AdlibRegister("copy", 1000)
Else
GUICtrlSetState($Checkbox1, 4)
MsgBox(48, "Bilgi", "İnternet Bağlantınız Yok! Lütfen Kontrol Edin..")
EndIf
Else
AdlibUnRegister("copy")
EndIf
Case $Combo1
	_SwitchTheme(GUICtrlRead($Combo1))
EndSwitch
$aInfo = GUIGetCursorInfo($hGUI)
If $aInfo[2] Then
If $aInfo[4] = $iInput Then
If GUICtrlRead($iInput) = "Buraya Linki Yapıştırarak Başlıyabilirsiniz.." Then
GUICtrlSetData($iInput, "")
EndIf
EndIf
EndIf
WEnd
_ReduceMemory()
Func _ByteSuffix($iBytes, $iRound = 2)
Local Const $aArray[9] = [' bytes', ' KB', ' MB', ' GB', ' TB', ' PB', ' EB', ' ZB', ' YB']
Local $iIndex = 0
While $iBytes > 1023
$iIndex += 1
$iBytes /= 1024
WEnd
Return Round($iBytes, $iRound) & $aArray[$iIndex]
EndFunc
Func _iestart($inpread)
GUISetState(@SW_LOCK)
GUICtrlSetState($iStartClose, 128)
$ie = ObjCreate("Shell.Explorer.2")
GUICtrlCreateObj($ie, 0, 0, 0, 0)
GUICtrlSetState(-1, 32)
$ie.navigate("http://www.youtube-mp3.org/")
_IELoadWait($ie)
$url = _IEGetObjById($ie, "youtube-url")
$submit = _IEGetObjById($ie, "submit")
_IEFormElementSetValue($url, $inpread)
_IEAction($submit, "click")
While 1
$ieread = _IEBodyReadHTML($ie)
If StringInStr($ieread, 'YouTube tarafından yapılan bir hata sebebiyle, bu video yi teslim edemiyoruz!') Then
MsgBox(48, "Error", "YouTube tarafından yapılan bir hata sebebiyle, bu video yi teslim edemiyoruz! Bu hata çoğunlukla telif hakları ile ilgili ya da video uzunluk süresinden dolayı kaynaklanır. Bizim tarafımızdan en fazla 20 dakika süreyi gecmiyen videolar destekleniyor.")
$name = "error"
ExitLoop
ElseIf StringInStr($ieread, 'Geçersiz URL:') Then
MsgBox(48, "Error", "Geçersiz Link Veya Url.")
$name = "error"
ExitLoop
ElseIf StringInStr($ieread, "Video başarıyla mp3 'e çevrildi") Then
$exp = StringRegExp($ieread, '<a href="(.*?)"><b>Download</b></a>', 3)
If $exp = 1 Then $exp = StringRegExp($ieread, '<A href="(.*?)"><B>Download</B></A>', 3)
$exp = StringReplace($exp[0], "amp;", "")
$sFilePathURL = "http://www.youtube-mp3.org" & $exp
$name = StringRegExp($ieread, '</b> (.*?)</div>', 3)
If $name = 1 Then $name = StringRegExp($ieread, '</B> (.*?)</DIV>', 3)
$name = $name[0] & ".mp3"
ExitLoop
EndIf
Sleep(100)
WEnd
$name = _replace($name)
GUISetState(@SW_UNLOCK)
GUICtrlSetState($iStartClose, 64)
Return $name
EndFunc
Func _image($imgread)
$imgread = StringSplit($imgread, "=")
$imgread = $imgread[2]
InetGet("http://i.ytimg.com/vi/" & $imgread & "/default.jpg", @TempDir & "\")
GUICtrlCreatePic(@TempDir & "\", 0, 0, 129, 105)
GUICtrlCreatePic(@TempDir & "\", 0, 0, 129, 105)
FileDelete(@TempDir & "\")
EndFunc
Func _InetGetGUI($sURL, $iLabel, $iProgress, $iButton, $sDirectory)
Local Enum $INETGET_ERROR_0, $INETGET_ERROR_1, $INETGET_ERROR_2
Local $sFilePath = StringRegExpReplace($sURL, '^.*/', '')
If StringStripWS($sFilePath, 8) == '' Then
Return SetError($INETGET_ERROR_1, 0, $sFilePath)
EndIf
$sFilePath = $sDirectory
Global $iFileSize = InetGetSize($sURL, 1)
Local $hDownload = InetGet($sURL, $sFilePath, 0, 1)
Local Const $iRound = 0
Local $iBytesRead = 0, $iPercentage = 0, $iSpeed = 0, $sProgressText = '', $sSpeed = 'İndirme Hızı: ' & _ByteSuffix($iBytesRead - $iSpeed) & '/s'
Local $hTimer = TimerInit()
Local $iError = $INETGET_ERROR_0, $sRead = GUICtrlRead($iButton)
GUICtrlSetData($iButton, 'İptal')
While Not InetGetInfo($hDownload, 2)
Switch GUIGetMsg()
Case -3, $iButton
GUICtrlSetData($iLabel, "0 MB / 0 MB" & @LF & "İndirme Hızı : 0 KB/s")
GUICtrlSetData($iInput, "Buraya Linki Yapıştırarak Başlıyabilirsiniz..")
$iError = 2
ExitLoop
EndSwitch
$iBytesRead = InetGetInfo($hDownload, 0)
$iPercentage = $iBytesRead * 100 / $iFileSize
$sProgressText = _ByteSuffix($iBytesRead, $iRound) & ' / ' & _ByteSuffix($iFileSize, $iRound) & @CRLF & $sSpeed
GUICtrlSetData($iLabel, $sProgressText)
GUICtrlSetData($iProgress, $iPercentage)
If TimerDiff($hTimer) >= 1000 Then
$sSpeed = 'İndirme Hızı: ' & _ByteSuffix($iBytesRead - $iSpeed) & '/s'
$iSpeed = $iBytesRead
$hTimer = TimerInit()
EndIf
Sleep(20)
WEnd
InetClose($hDownload)
GUICtrlSetData($iButton, $sRead)
If $iError > $INETGET_ERROR_0 Then
FileDelete($sFilePath)
$sFilePath = ''
EndIf
Return SetError($iError)
EndFunc
Func _ReduceMemory()
Local $ai_GetCurrentProcessId = DllCall('kernel32.dll', 'int', 'GetCurrentProcessId')
Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $ai_GetCurrentProcessId[0])
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
Return $ai_Return[0]
EndFunc
Func _replace($replace)
$replace = StringReplace($replace, "<", "")
$replace = StringReplace($replace, ">", "")
$replace = StringReplace($replace, "|", "")
$replace = StringReplace($replace, "/", "")
$replace = StringReplace($replace, "\", "")
$replace = StringReplace($replace, ":", "")
$replace = StringReplace($replace, '"', '')
$replace = StringReplace($replace, "?", "")
$replace = StringReplace($replace, "*", "")
$replace = StringReplace($replace, "amp;", "")
Return $replace
EndFunc
Func _switch()
Switch @error
Case 1
MsgBox(48, 'Hata', 'İntnernet Bağlantınızda Veya Youtube URL nizde Hata Var.')
If GUICtrlRead($Checkbox1) = 1 Then
$history = GUICtrlRead($iInput)
AdlibRegister("copy", 1000)
EndIf
GUICtrlSetData($iInput, "Buraya Linki Yapıştırarak Başlıyabilirsiniz..")
Case 2
GUICtrlSetData($iProgressBar, 0)
GUICtrlSetData($iLabel, "0 MB / 0 MB" & @LF & "İndirme Hızı : 0 KB/s")
GUICtrlSetData($Label2, "  Youtube MP3 Downloader'a Hoş Geldiniz!")
MsgBox(48, "Bilgi", "İndirme İşlemi İptal Edildi..")
If GUICtrlRead($Checkbox1) = 1 Then
$history = GUICtrlRead($iInput)
AdlibRegister("copy", 1000)
EndIf
GUICtrlSetData($iInput, "Buraya Linki Yapıştırarak Başlıyabilirsiniz..")
Case Else
If $iFileSize = FileGetSize(@ScriptDir & "\" & $name) Then
MsgBox(64, "Bilgi", "Dosya Başarıyla İndirildi !")
_WinAPI_ShellOpenFolderAndSelectItems(@ScriptDir & "\" & $name)
GUICtrlSetData($iProgressBar, 0)
GUICtrlSetData($iLabel, "0 MB / 0 MB" & @LF & "İndirme Hızı : 0 KB/s")
GUICtrlSetData($Label2, "  Youtube MP3 Downloader'a Hoş Geldiniz!")
If GUICtrlRead($Checkbox1) = 1 Then
$history = GUICtrlRead($iInput)
AdlibRegister("copy", 1000)
EndIf
GUICtrlSetData($iInput, "Buraya Linki Yapıştırarak Başlıyabilirsiniz..")
Else
FileDelete(@ScriptDir & "\" & $name)
GUICtrlSetData($iProgressBar, 0)
GUICtrlSetData($iLabel, "0 MB / 0 MB" & @LF & "İndirme Hızı : 0 KB/s")
GUICtrlSetData($Label2, "  Youtube MP3 Downloader'a Hoş Geldiniz!")
MsgBox(48, "Bilgi", "Dosya İndirilemedi ! Site Mp3'ü Desteklemiyor Olabilir..")
If GUICtrlRead($Checkbox1) = 1 Then
$history = GUICtrlRead($iInput)
AdlibRegister("copy", 1000)
EndIf
GUICtrlSetData($iInput, "Buraya Linki Yapıştırarak Başlıyabilirsiniz..")
EndIf
;If Not FileExists(@TempDir & "\youtube.jpg") Then _youtube_image(1, @TempDir)
;GUICtrlCreatePic(@TempDir & "\youtube.jpg", 0, 0, 129, 105)
;GUICtrlCreatePic(@TempDir & "\youtube.jpg", 0, 0, 129, 105)
EndSwitch
EndFunc
Func copy()
$clipget = ClipGet()
If StringInStr($clipget, "www.youtube.com/watch?v=") And $clipget <> $history Then
AdlibUnRegister("copy")
If MsgBox(35, "İndireyim mi ?", "Yeni Bir Şarkı Algılandı İndirilsin mi ? :" & @LF & @LF & $clipget, 0, $hGUI) = 6 Then
If Ping("www.google.com", 1000) Then
GUICtrlSetData($iInput, $clipget)
WinActivate($hGUI)
GUICtrlSetData($Label2, " Şarkı Hazırlanıyor Lütfen Bekleyiniz...")
$name = _iestart(GUICtrlRead($iInput))
If $name <> "error" Then
$sFilePathURL = $exp
_image($clipget)
GUICtrlSetData($Label2, "  " & $name)
$sFilePath = _InetGetGUI($sFilePathURL, $iLabel, $iProgressBar, $iStartClose, @ScriptDir & "\" & $name)
_switch()
EndIf
Else
MsgBox(48, "Error", "İnternet Bağlantınız Yok!")
$history = $clipget
AdlibRegister("copy", 1000)
EndIf
Else
$history = $clipget
AdlibRegister("copy", 1000)
EndIf
EndIf
EndFunc

Program Yazmanın En Güzel Yanı Birilerinin Bu Programlardan Faydalandığını Görmektir..



Kullanıcı avatarı
BlueLife
Byte3
Byte3
Mesajlar: 148
Kayıt: 29 Ağu 2014, 20:42

Re: Youtube Mp3 Downloader

Mesaj gönderen BlueLife » 16 Oca 2018, 11:02

@darendeli

Kodlama uzun olduğu için malesef incelemek için zaman ayıramam. Kodlarına bakmadım ama heralde autoit ile birden fazla işlem yaptırmak istiyorsun. Yeni sürümleri bilmiyorum lakin eski sürümlerde malesef autoit bir exe üzerinden birden fazla işlemi tam desteklemiyordu. Çalışıyor lakin çok fazla hata veriyordu (bir nevi kullanılamıyor). Birden fazla işlem için exenin kopyası arkaplanda (parametre ile) gizli olarak çalıştırılabilir ama buda kodlama olarak uğraştırıcı.

Kısaca indirme işlemini gizli çalışan programın kopyası yapar ve bilgileri diğer ana exeden çalışan guide günceller.
Fazla zaman ayıramadığım için yardımcı olmadım kusura bakma...

darendeli
Byte3
Byte3
Mesajlar: 147
Kayıt: 06 Haz 2016, 16:55

Re: Youtube Mp3 Downloader

Mesaj gönderen darendeli » 16 Oca 2018, 20:41

Evet Yapmak istedigim Tam olarak Oydu Yinede Tesekkürler
Program Yazmanın En Güzel Yanı Birilerinin Bu Programlardan Faydalandığını Görmektir..

Cevapla