Auto-downloader
blargmob

Alright I'm writing a program using wget in C++. Now I need to know this:
Say I have a base webpage where all the downloads are, such as:

Base Page: www.coolvideos.com/funny/index? All video downloads have links like: www.coolvideos.com/funny/index?owned.wmv www.coolvideos.com/funny/index?car.wmv www.coolvideos.com/funny/index?arm.wmv

Now, using wget, how can I have the program auto-magically download all the videos that are on the page www.coolvideos.com/funny/index? without entering the names in manually?

???

bamccaig

I'm not very familiar with wget, but I think you need to give it a file URL. If you gave it the URL for /funny/index you would more than likely download just that because the Web server would give wget what it asked for. What you need is to get a list of the files available at the URL so you can request them individually.

For example, DownThemAll, a Firefox extension lists all of the links in a Web page as well as the images. You can then select which ones you want to download. I don't think there is any way of automagically determining what files are available on any Web server. Some Web servers seem to be configured to give a directory listing when a directory is requested (and no default resource exists), however, that can't be relied upon.

Hopefully better replies will follow. :)

CGamesPlay

Yes. Read wget --help for more information.

bamccaig
CGamesPlay said:

Yes. Read wget --help for more information.

Oh wow, it's so much more powerful than I thought it was. :o

Hard Rock

Can you stop starting 8 different threads (well you have 3 right now) that are all for the same purpose?

Goalie Ca

try curl. It's a program and a library.

blargmob

Thanks for the help,and I'll stop posting new threads.But now I got the project finished and I want to put it on another PC. But when I try to, it tells me the app failed to launch because it wasn't configed properly. I built the project for a release in MSVC, now what do I do?

ReyBrujo

Check here and here for wget help.

blargmob

It's not a problem with wget, it's a problem with me...I don't know how to release this binary and have it run properly on another machine, like what resources it needs..

ReyBrujo

Click here, it should start downloading a zip package, unzip it and get wget.exe, that should be all you need. Now, the best you can do is creating a txt file with all the videos you want to download, one link per line, and execute wget -i file.txt

blargmob

Well, the other machine already has wget.exe in WINDOWS. And it still says that the app wasn't configed properly. What am I missing? Are there certain dll's I need?

ReyBrujo

Not really, try executing wget http://www.google.com to see what it does. Also, do wget --version to see which version is.

blargmob

The wget on the other machine works fine, it's just that I can't run my c++ program on it..

ReyBrujo

Ah, and your program uses Allegro? Then you need alleg42.dll (or whichever version you used to compile the program). Also, if you compiled with Visual C++, the C++ runtime files (although you likely already have them, unless you are using a very new compiler and tried to run the executable in a very old computer).

blargmob

Nah..it doesn't use allegro..but it still refuses to operate. ???

ReyBrujo

Can you tell me anything else other than "refuses to operate"? There are thousands of reasons about why the program would not run and, believe me, you don't want me to start enumerating them.

emupaul

Goalie Ca said:

try curl. It's a program and a library.

I mentioned this lib in a different thread =), I say let em' fumble with wget.

BAF

What compiler did you use to compile the program?

blargmob

I'm using Visual Studio 9.0 (2008), so whatever compiler that comes with. I don't think that it's a real big, internal problem. I've had this issue before and it was just a simple problem with some kind of dll's or other resources.

What I'm doing is building the app as a release, than I'm simply copying the output .exe into the LAN and pasting it onto the other machines desktop. When I try to run it, I get a window that says:

This application has failed to start because the application configuration is incorrect.

???

BAF

Thats your problem. You need the right MSVC runtime components on the other computer. I don't know much about it, but Matthew does.

Matthew Leverton

Compile with /MT to use the static runtime. If you use any other libraries, you'll have to compile them the same way.

blargmob

@BAF:

You're probably right, but then how come an allegro app runs fine on the other machine when all I need to include with the binary are the dll's and images, sounds etc. ???

@Mat:

/MT? What's that? :-/

Matthew Leverton
blargmob

Hmm..so I changed the Runtime Library option to /MT, and I got lots of errors saying that functions were already defined in [fillintheblank].dll ??? That's not supposed to happen! :(

Matthew Leverton

Do you a clean rebuild and heed my advice "If you use any other libraries, you'll have to compile them the same way."

blargmob

I did a clean rebuild and that reduced some errors, but there still 4 unresolved externals. So..how do I recompile the other libs I'm using with MT? :-[ (don't know much about this kind of internal work..:-)

ReyBrujo

Which unresolved externals? There could be thousands of those and, believe me, you don't want me start enumerating them.

blargmob

Here they are:

Warning 2 warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library Auto-download Error 3 error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator >,class std::allocator<class std::basic_string<char,struct std::char_traits,class std::allocator > > >:: operator[](unsigned int)" (??A?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAEAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@I@Z) Auto-download.obj Error 4 error LNK2001: unresolved external symbol __CrtDbgReportW libcpmtd.lib Error 5 error LNK2001: unresolved external symbol __CrtDbgReportW libcpmtd.lib Error 6 error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z) libcpmtd.lib Error 7 error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z) libcpmtd.lib Error 8 error LNK2019: unresolved external symbol __calloc_dbg referenced in function __Getctype libcpmtd.lib Error 9 fatal error LNK1120: 4 unresolved externals C:\Documents and Settings\Owner.Cortana\My Documents\Visual Studio 2008\Projects\Auto-download\Debug\Auto-download.exe 1

?????????

Matthew Leverton

That's a debug library. /MT is static release, so you've got some mixing of release types going on.

blargmob

:(

I'm not getting this one bit..how do I find what release types are mixing?

Matthew Leverton

If you don't know how to compile things properly, then you could go back to your original method (/MD) and just install this on whatever computer needs to run it.

blargmob

Wow. Thanks! ;D

ReyBrujo

All that work and no cookies? :P

blargmob

Oh yeah!

http://www.chocolate-chip-cookie-recipes.com/images/chewy-chocolate-chip-cookies.jpg

BAF

We mean a.cc cookies.

blargmob

Well than, you should already have those shouldn't you? :P

Thread #594753. Printed from Allegro.cc