【问题标题】:how to download WWDC 2010 video now by curl or wget?现在如何通过 curl 或 wget 下载 WWDC 2010 视频?
【发布时间】:2016-07-20 11:22:55
【问题描述】:

例如:https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2010__hd/session_122__accessibility_on_iphone_os.mov

当我进入时

curl https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2010__hd/session_122__accessibility_on_iphone_os.mov > ~/Desktop/122.mov

或

wget https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2010__hd/session_122__accessibility_on_iphone_os.mov > ~/Desktop/122.mov

都失败了,只下载一个 333KB 的文件。

【问题讨论】:

    标签: ios curl wget wwdc


    【解决方案1】:

    您获得的 mov 文件只是一个参考文件,用于为您的网络连接选择更正文件。

    如果你有mplayer,可以试试mplayer <url> -dumpstream -dumpfile <filename>。

    您也可以打开文件并找到正确的真实文件的文件名。

    您也可以编写一些脚本来解析参考文件。 这是我在 perl 中编写的用于解析 mov ref 文件的函数:

    sub parseMov
    {
        $uri = $_[0];
        $result_uri = "";
        @arr_uris = ();
    
        my $content = get $uri;
    
        $content =~ "/[^[:print:]]//g";
    
        @arr_movs = split("rmdr", $content);
    
        foreach (@arr_movs)
        {   
           @arr_parts = split("url", $_);
           my $file = $arr_parts[-1];
    
           if (index($file, ".mov") != -1 || index($file, ".3gp") != -1 || index($file, ".m4v") != -1) 
           {
               #remove first char
               $file = trim($file);
               $file = substr($file,4);
               push( @arr_uris, $file);
           }
       }
    
       #determine basePath
       my @pathComponents = split("/", $uri);
       $basePath = $uri;
       $basePath =~ s/$pathComponents[-1]//;
    
       my $biggestSize = 0;
    
       #get biggest file
       foreach (@arr_uris)
       {
           $uri_item = "$basePath$_";
    
           my $size = getFilesize($uri_item);
    
           if ($size > $biggestSize)
           {
              $finalURL = $uri_item;
              $biggestSize = $size;
           }
    
       }
    
       #remove %00 and %10 chars
       $finalURL =~ s/\x10//;
       $finalURL =~ s/\x00*//g;
    
       return $finalURL;
    

    }

    【讨论】:

    • 非常感谢。我运行您在此处键入的脚本。出现错误消息“无法通过包定位对象方法“get””,有什么建议吗?
    • 你需要安装LWP 在终端上试试下面cpan install LWP HTTP::Request
    猜你喜欢
    • 1970-01-01
    • 2018-06-16
    • 2016-12-04
    • 1970-01-01
    • 2011-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多