<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -129,14 +129,20 @@ def main():
         _, urlfilename = os.path.split(urlpath)
         
         # Generate wget command
-        grab_command = [&quot;curl&quot;, cur['flv'], &quot;-o&quot;, urlfilename, &quot;-C&quot;]
-    
+        grab_command = [&quot;curl&quot;, &quot;-L&quot;, &quot;-A&quot;, &quot;\&quot;Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\&quot;&quot;, &quot;-C&quot;, &quot;-&quot;, cur['flv'], &quot;-o&quot;, urlfilename]
         print &quot;Getting FLV file:&quot;
         print grab_command
         gproc = subprocess.Popen(grab_command)
         gproc.communicate()
+        if gproc.returncode != 0:
+            print &quot;Non-zero exit code: %s&quot; % gproc.returncode
+            continue
         print
 
+        if not os.path.isfile(urlfilename):
+            print &quot;Downloaded file \&quot;%s\&quot; not found, not transcoding&quot; % urlfilename
+            continue
+
         transcoded_name = &quot;Zero Punctuation - [%02d] - %s.mp4&quot; % (counter, cur['title'])
 
         print &quot;Transcoding:&quot;
@@ -144,6 +150,9 @@ def main():
         transcode_cmd = t.getcommand(transcoded_name)
         tproc = subprocess.Popen(transcode_cmd)
         tproc.communicate()
+        if gproc.returncode != 0:
+            print &quot;Non-zero exit code: %s&quot; % gproc.returncode
+            continue
         print
         
         # Mark as done, as save</diff>
      <filename>zp_ipod.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f475a2478ca0861a0ba4ba98207c206ce2e9f921</id>
    </parent>
  </parents>
  <author>
    <name>dbr</name>
    <email>dbr.onix@gmail.com</email>
  </author>
  <url>http://github.com/dbr/zp_grabber/commit/47c7a28cbb118afe71a469b6a0acf3451af41b91</url>
  <id>47c7a28cbb118afe71a469b6a0acf3451af41b91</id>
  <committed-date>2009-09-03T10:19:32-07:00</committed-date>
  <authored-date>2009-09-03T10:19:32-07:00</authored-date>
  <message>Fix curl command (follow redirects, change user agent), check return codes, check file is retrived correctly</message>
  <tree>13952dd32d6f4a0ca204b18f6a6b8a81a05e3d23</tree>
  <committer>
    <name>dbr</name>
    <email>dbr.onix@gmail.com</email>
  </committer>
</commit>
