[colug-432] Podcast script
Angelo McComis
angelo at mccomis.com
Mon Mar 29 12:13:47 EDT 2010
If the original first URL you pull has a reference to the mp4 in a
HREF tag, the mirror follow directive handles that properly. If it's
not a link via a HREF, then you need to break out your RegEx Fu.
- Angelo
{via mobile device}
On Mar 29, 2010, at 11:47 AM, Bill Baker <bill_chris at earthlink.net>
wrote:
> The thing is, the URL to the .mp4 file changes every day. I need to
> download the .xml file and have the script search for that URL within
> the .xml file.
>
> On Mon, 2010-03-29 at 11:35 -0400, Angelo McComis wrote:
>> Bill- there are options to wget that would allow you to do what you
>> want all on one line.
>>
>> Look at some of the include and mirroring flags.
>>
>> I'm not at a terminal but you coils essentially say
>>
>> Wget --include=m4v --mirror URL savepath
>>
>>
>> - Angelo
>>
>> {via mobile device}
>>
>> On Mar 29, 2010, at 11:28 AM, Bill Baker <bill_chris at earthlink.net>
>> wrote:
>>
>>> I'm trying to write a script that downloads a web page that has the
>>> URL
>>> for a podcast on it, searches for the URL (which ends with .m4v) and
>>> downloads it to my Desktop. Here's what I have so far:
>>>
>>> ---------------
>>> #!/bin/bash
>>> wget --no-cache http://podcasturl/podcast.xml
>>> url=`grep .m4v podcast.xml`
>>> wget $url -O ~/Desktop
>>> rm podcast.xml
>>> ---------------
>>>
>>> I know that in the third line grep doesn't work because it returns
>>> the
>>> whole line, not just the URL. Is there anything else I can use to
>>> get
>>> it to return just the URL?
>>>
>>> _______________________________________________
>>> colug-432 mailing list
>>> colug-432 at colug.net
>>> http://lists.colug.net/mailman/listinfo/colug-432
>
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432
More information about the colug-432
mailing list