Hello People…
I know this has be coverd alot of times, but i’m still a bit confused on how to make this
i’m using a python script called youtube-dl.py to download videos from youtube, and all
data are currently saved to a .txt file which is loaded to a textview when video is downloaded
all this is working as is, but would like to see the data as it updates …the file is provied below
on clicked theObject
set object_name to (name of theObject) as string
if object_name = “grab_video” then
set video_url to contents of text field “video_url” of window 1
if video_url is equal to “” then
display dialog “Please enter youtube URL (http://www.youtube.com/watch?v=)”
return
end if
set video_dest to contents of text field “video_dest” of window 1
if video_dest is equal to “” then
display dialog “Please enter save destination”
return
end if
set dlscript to POSIX path of (path to me) & "Contents/Resources/getyoutube.py"
set dlfile to do shell script dlscript & " -lbd" & " " & video_dest & " " & video_url
logExecute(dlfile, 1)
set contents of text field "video_url" of window 1 to "http://youtube.com/watch?v="
set myTextView to (text view "tv" of scroll view "sv" of window 1)
set myFilePath to POSIX path of (path to home folder) & "logFile.txt" as text
call method "setString:" of myTextView with parameter (call method "stringWithContentsOfFile:encoding:error:" of class "NSString" with parameters {myFilePath, 4, null})
end if
end clicked
Requesting video … Done.
Converting video title… Done.
Converting video URL… Done.
Requesting Video File… Done.
Downloading Video… Started.
Opened /Users/mkh/Desktop/Milk Chocolate: A Love Story-7NNZ5Jo51Y8.mp4 for writing
Retrieving video data: 0.0% ( 0b of 2.68M) at N/A b/s ETA --:–
Retrieving video data: 0.4% ( 10.00k of 2.68M) at 166.73k/s ETA 00:16
Retrieving video data: 1.1% ( 30.00k of 2.68M) at 232.21k/s ETA 00:11
Retrieving video data: 2.6% ( 70.00k of 2.68M) at 282.90k/s ETA 00:09
Retrieving video data: 5.5% ( 150.00k of 2.68M) at 416.59k/s ETA 00:06
Retrieving video data: 11.3% ( 310.00k of 2.68M) at 625.57k/s ETA 00:03
Retrieving video data: 23.0% ( 630.00k of 2.68M) at 804.61k/s ETA 00:02
Retrieving video data: 46.4% ( 1.24M of 2.68M) at 931.28k/s ETA 00:01
Retrieving video data: 86.9% ( 2.32M of 2.68M) at 1016.76k/s ETA 00:00
Retrieving video data: 100.0% ( 2.68M of 2.68M) at 994.96k/s ETA 00:00 Done.
Video saved to /Users/mkh/Desktop/Milk Chocolate: A Love Story-7NNZ5Jo51Y8.mp4
youtube script can be downloaded here. note that this is not the same as is use, i’ve made
a few patches to it…