How would you build a youtube video downloader with ZP?

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0
I wonder if anyone would be kind enough to tell me how. Before it seemed easier because keepvid.com was browser based, but now what can we do?
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
I use the command line tool youtube dl which you can find here...
Код:
https://github.com/rg3/youtube-dl/downloads
Use own program to use youtube-dl like this...

"C:\youtube-dl.exe" -o C:\vids\WHAT YOU WANT To NAME YOUR FILE.flv "YOUTUBE URL GOES HERE"

Of course, youtube-dl.exe will have to be in the root folder or change the path to suit you.
 

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0
Hi, thanks for response.

Do you mean use the youtube-dl file in that zip folder to introduce your string into a zennoposter step that would consist of 'own code'?
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
yes, that's exactly what you do JP. Unzip the youtube-dl.rar file and put the youtube-dl.exe in your root directory to use the code that I gave you. I found it best to save the vids in a folder in the root directory also. Here's a little template that I did that will take your scraped urls and download the vids.

Посмотреть вложение Download.xml
 
  • Спасибо
Реакции: archel

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0
Hi,

Well, I downloaded the link as a zip, put the youtube-dl file in my C:\ then I ran your zp template in projectmaker but it tells me 'the system can't find the specified file'. Thinking it could be the file extension I had wrong, I added '.exe' to the name of the file but now I'm getting 'unknown error (0xdb)'. So maybe the youtube downloading script is broken?
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
It's working for me. It may be a path problem. You may have to add the exe to your Path in order for it to work. Try that first and see if that helps. If you don't know how to do it, here's a tutorial.

Код:
http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx
 

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0
Hi, thanks for response. I am growing pretty desperate after trying a php script that also wouldn't do anything at all when I supposedly run it in the ZP template in a secure area i.e. my localhost xampp..

ZP is on a vista pc, but I'm not sure I understand at all this path thing. Isn't the binary path just a folder in the windows, like ''c:\youtube-dl.exe'' -o c:\vids\field data.flv'' field data of other string split''

In environment variable in system properties, all I'm seeing are a bunch of variables and values, like temp and an appdata folder, and I come to understand that variables act like shortcuts. The variables like my virtualbox variable. But the thing is in the path call that you gave me I'm not calling out for a variable, just an ''-o''.

Btw, in the string split I'm not getting any exec results. Maybe the problem lies there in that it's not finding a file to imprint the youtube video into?

It's telling me it 'can't find the specified file'.

When the binary is done in project maker, I get something like this in Binary:

''C:\youtube-dl.exe'' -o C:\vids\difohsdif.flv''

So it seems it found the youtube downloader, but the problem perhaps lies elsewhere?
 

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0
The key may be in why string out title, split out description and split out URL are giving no results. I'm not sure I understand what they're there for. Perhaps it's to later on define the name of the file? Maybe ZP isn't downloading anything if it can't name the file something?
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
That may be the problem. I would suggest disconnecting that part of the template and just inputting a youtube url in the own code part of the program and see if that works. I built this for a certain purpose and it's not necessary for you to do that for the code part of the template to work. Try running just this in debug and see if it will download the video for you....

Посмотреть вложение Downloadtest.xml
 

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0
Unfortunately, still no luck and it won't work for me.

I'm completely baffled.

Still the same old story of 0xs8 error if I change the name of the youdube-dl file to exe, and if I don't change it to exe I get 'system can't find the specified file', just like before. I substitued your youtube semilink with any old one at youtube.
 

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0
I think the key here may be in how it's giving me three kinds of errors depending on the binary path I write. I now realise the youtube link you gave me also works, despite redirecting, so I'll keep it as it is. When I extract all the files from the downloaded Zip file into C:\, if I write:

"C:\youtube-dl.exe" -o C:\vids\funny_video.flv "http://youtu.be/fulTZ9aoBms"

And I don't touch the youtube-dl file, I get the ZP3 message that:

''The system couldn't get the specified file''.

However, if I modify the name of the file to make it correspond to an .exe file, I get:

''The Program can't be initiated in a 64 bit Windows environment because it is 16 bits.''

Aha!

Damn. I don't have a 32/16 bit environment unless I can fake one...


(Also, reading their docs, I see that maybe I should have Python installed somewhere in my system? If so, where?
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
I have python installed in my root directory. That's strange that you get the message about 16 bits because I have it installed on a 64 bit system. I had installed Python a long time ago for something else so that may be the problem. Sorry I didn't think of that. I do believe you can Python installed anywhere but you must have a call to it in PATH so that the commandline will know where to look for it. I gave you the link the other day on how to add something to your PATH.
 

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0
Unfortunately, I added a PATH and a VARIABLE to environment variables, but got no result whatsoever. I tried creating the variable 'youtube-dl' to name it. And the value 'C:\youtube-dl.exe' and it didn't work. I tried the value 'C:\youtube-dl' and no luck at all. :((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((

I installed Python on my windows vista. Python.2.7.2.msi from the site. Not the amd64.msi version, just in case it accused me of using a 64 bit python. And no luck.

I even tried googleneedle.com and input the youtube links into their page, but that prompts a 'save or open' window in internet explorer 9 which ZP has no control over. In line with my pathetic luck, I looked up how to eliminate the prompt in my explorer but unlike in many other guides the option to eliminate the prompt simply isn't there. Some guides suggest to play around regedit to fix this, but every single time I've ever played around with regedit in the past I've had to restore my PC to factory conditions...

But the main issue is why on earth now that I've established a path, installed python, failed at running a youtube page through a script my localhost..., failed at running a program because it just refuses to find it... why on earth does everything buggy, slow, every single issue I learn on the internet take me ages to fix. I just don't understand and I'm so frustrated... it's like murphy's law when it comes to my learning, whatever bad thing that could happen does happen...
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
Did you add the path to python in your PATH variable? C:\Python27\;
 

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0
Do you mean to create a path in environment variables with

Variable: Python
Value: C:\Python27\;

I just did right now when you mentioned it, but I've noticed no difference, it still says system can't find the specified file.
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
JP, you should just put the value C:\Python27\; in your PATH variable. Let me put up a vid for you to look at to show you. This value should corespond to where Python is installed on your computer. If you installed it in your documents folder then the path would be different. I installed mine in the C:\ drive. If anything, it could be the fact that you are using Vista. Have you changed your user account settings to allow programs to run without you confirming it? I don't have Vista, but my son's computer is a bitch to run programs on because of this.

Here's the vid:

http://www.youtube.com/watch?v=edC3yDyDRm0
 

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0
Hi, thanks a lot for helping out.

However, the PATH has the following as default:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\hp\bin\Python

Do you still think I should modify it despite it seeming to have a folder with Python in it? It's a hidden folder that might have been created in parallel to the C:\Python27 which isn't hidden.

I'll try it in win7 later on tonight and hope for the best.
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
Okay JP, I may have found a solution to the problem. Searched around and found this. Maybe this will help you out.

Код:
http://www.himili.com/blog/downloads/youtube-video-downloader/
 

jp1

Client
Регистрация
23.01.2011
Сообщения
234
Благодарностей
2
Баллы
0
Hey thanks a lot, you were very helpful on this and I was getting pretty desperate. I actually managed to get a blogger who'd posted a PHP version of a youtube downloading script to update his and it worked fine, but I had to move on to other projects as this one was proving too time consuming. I will however put both yours and his findings to the test in the future, and thanks again.
 

lupo

Client
Регистрация
28.05.2012
Сообщения
72
Благодарностей
32
Баллы
18
I use the command line tool youtube dl which you can find here...
Код:
https://github.com/rg3/youtube-dl/downloads
Use own program to use youtube-dl like this...

"C:\youtube-dl.exe" -o C:\vids\WHAT YOU WANT To NAME YOUR FILE.flv "YOUTUBE URL GOES HERE"

Of course, youtube-dl.exe will have to be in the root folder or change the path to suit you.
Thank you for sharing this great software, it's working just perfect!
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)