Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 20:28

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



YT to MP3/MP4 and captcha

Discussion on YT to MP3/MP4 and captcha within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2012
Posts: 7
Received Thanks: 0
YT to MP3/MP4 and captcha

Inspired by this tutorial I wanted to make MP4 downloader too
How code looks in the beggining

PHP Code:
#include <_httprequest.au3>
#include <string.au3>
$url InputBox('YoububeToMp3','Type url video...')
if @
error Then Exit
YoububeToMp3($url)
Func YoububeToMp3($url,$dir=@ScriptDir,$type='mp3')
$id _StringBetween($url,'watch?v=','')[0]
$oIE _httprequest(2,'https://www.download-mp3-youtube.com/api/?api_key=MzQ3NzQzNDYz&format='&$type&'&video_id='&$id)
$link _StringBetween($oIE,'src="','"')[0]
$oIE _httprequest(2,$link)
$name _StringBetween($oIE,'<div class="buttonTitle">','</div>')[0]
$oIE =_StringBetween($oIE,'id="downloadButton" href="','"')[0]
$linkdowload 'https://www.convertmp3.io'&$oIE
ProgressOn
('''Downloading '&$name&'.'&$type'0%')
Local $BinaryData _HttpRequest(3$linkdowload''''''''''ProgressFunc)
If @
error Then
MsgBox
(16,'Error',"Couldn't download file!!")
   Exit
EndIf
ProgressOff()
_HttpRequest_Test($BinaryData$dir '\'&$name&'.'&$type,Default,False)
EndFunc
Func ProgressFunc($NowSize, $TotalSize)
$iPercent = Round(100 * $NowSize / $TotalSize, 2)
ProgressSet ($iPercent, $iPercent & '
%', 'Downloading...' & Round($NowSize / (1024 ^ 2), 2) & 'Mb')
EndFunc 
So I founded that site with MP4 API too. There is written how to make API link similar like above in script
Code:
https://lolyoutube.com
How could look example link for this API
Code:
https://lolyoutube.com/download/mp3/HLVjWH8deew/1537966320
so how code looks for lolyyoutube downloader
PHP Code:
 make request for the link
    $oIE 
_httprequest(2,'https://lolyoutube.com/download/' $format '/' $id '/' $timestamp)
    ; 
but there is no src attrib 
    $link 
_StringBetween($oIE,'src="','"')[0] ; iframe button with src attribute
    
so cant make http request to the link
    $oIE 
_httprequest(2,$link
as we can see button has no src attrib and I cant get link for this, its generated in Javascript and how to click that button?

Next is Recaptcha button too similar too this button

I tracked whats going on on and got something like that.



how to click that captcha with autoit?



see something here is like
Code:
 ; Click on ReCaptcha checkbox
        $idivs = _IETagNameGetCollection($iframe, 'div')
        For $idiv In $idivs
            If $idiv.classname = 'recaptcha-checkbox-checkmark' And $idiv.attributes.item('role').value="presentation" Then
                $idiv.click()
            EndIf
        Next
and it click captcha i saw but it has to open IE
Szmycu is offline  
Old 09/28/2018, 16:31   #2
 
chronicles666's Avatar
 
elite*gold: 0
Join Date: Jul 2013
Posts: 37
Received Thanks: 9
Why make your life harder trying to use such shoddy websites, when youtube-dl already exists and you can use that instead?
No captchas, no manual HTML parsing, etc. It's implemented in Python, and you can use it as a python library straight away, but if you (don't know/don't want to get to know) Python, then you can just call the youtube-dl script from AutoIt with Run, RunWait, and the likes.
It's going to be much easier to parse the output of this command and retrieve data of interest, eg. stream-specifiers.
You can download mp4 files straight away from YouTube, but as for mp3, YouTube doesn't use that format internally, so you either download audio encoded with Opus/AAC/Vorbis and use that, or if you really need mp3, you can transcode with ffmpeg like this:
Code:
ffmpeg -i input.m4a -c:a libmp3lame -q:a 2 output.mp3
For details, refer to the documentation of ffmpeg, which you can find here:
chronicles666 is offline  
Thanks
1 User
Old 10/08/2018, 22:33   #3
 
elite*gold: 0
Join Date: Nov 2012
Posts: 7
Received Thanks: 0
gratefuly thanks
Szmycu is offline  
Reply

Tags
autoit, downloader, mp3, youtube


Similar Threads Similar Threads
How to convert DRM protected music and movies to MP4/AVI/MOV/MP3/WMV/AAC...
04/25/2010 - Main - 0 Replies
Many people ask me the same question: "I purchased videos on iTunes, but I can't play them on my video player, because they are in some 'protected' M4V format that only works on iPods. How can I convert iTunes videos to MPEG or WMV format so I can play them on My portable video device such as Archos and Creative Zen?" I searched on Google, Yahoo answers and post the question on large number of forums, unfortunately, after scouring the Web for days, I couldn't find a FREE way to convert M4V...



All times are GMT +1. The time now is 20:30.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.