Changeset 600e713 for server/lib/gutenbach
- Timestamp:
- Aug 16, 2010, 8:15:05 PM (14 years ago)
- Branches:
- master, debian, mac, no-cups
- Children:
- 04a6a66
- Parents:
- 9dee329
- git-author:
- Kyle Brogle <broglek@…> (08/16/10 20:15:05)
- git-committer:
- Kyle Brogle <broglek@…> (08/16/10 20:15:05)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/lib/gutenbach
r79fac02 r600e713 174 174 # YouTube URLs are resolved by the youtube-dl command. 175 175 # Launch youtube-dl 176 $pid = open(YTDL, "-|"); 177 if ($pid) { 178 print ZEPHYR "YouTube video $filepath.\nCurrently downloading, please wait..."; 179 close ZEPHYR; 180 while (<YTDL>) { 181 open(ZEPHYR, "|-", @zwrite_command); 182 print ZEPHYR $_; 183 close ZEPHYR; 184 } 185 open(ZEPHYR, "|-", @zwrite_command); 186 print ZEPHYR "Done downloading."; 187 close ZEPHYR; 188 } 189 else { 190 my @args = ("youtube-dl", "-q", "-o", "/tmp/youtube.flv", $filepath); 191 exec(@args) or die "Couldn't exec youtube-dl"; 192 } 193 194 $filepath = "/tmp/youtube.flv"; 195 # Print the title to zephyr and the status string. 176 $pid = open(YTDL, "-|", "youtube-dl","-b", "-g", $filepath) or die "Unable to invoke youtube-dl"; 177 print ZEPHYR "YouTube video $filepath\n$title"; 178 $status .= " YouTube video $filepath. $title."; 179 # youtube-dl prints the URL of the flash video, which we pass to mplayer as a filename. 180 $filepath = <YTDL>; 181 chomp $filepath; 182 183 196 184 } else { # Doesn't appear to be a YouTube URL. 197 185 print STDERR "Resolved external reference to $filepath\n";
Note: See TracChangeset
for help on using the changeset viewer.