{"id":909,"date":"2024-12-14T13:05:37","date_gmt":"2024-12-14T05:05:37","guid":{"rendered":"https:\/\/keyi.eu.org\/?p=909"},"modified":"2024-12-14T13:06:00","modified_gmt":"2024-12-14T05:06:00","slug":"gigafile%e6%89%b9%e9%87%8f%e4%b8%8b%e8%bc%89%e8%85%b3%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/keyi.eu.org\/?p=909","title":{"rendered":"gigafile\u6279\u91cf\u4e0b\u8f09\u8173\u672c"},"content":{"rendered":"<p><img src=\"https:\/\/keyi.eu.org\/wp-content\/uploads\/2024\/12\/bloggigafile\u6279\u91cf\u4e0b\u8f09\u8173\u672c.png\" alt=\"gigafile\u6279\u91cf\u4e0b\u8f09\u8173\u672c\"><br \/>\n\u4ee5\u524d\u9762\u4e00\u6587\u6240\u63a8\u85a6\u7684gigafile\u7db2\u76e4\u547d\u4ee4\u884c\u5f0f\u64cd\u4f5c\u8173\u672c\uff08https:\/\/keyi.eu.org\/?p=904\uff09\u7232\u57fa\u790e\uff0c\u5beb\u6210\u4e86\u6279\u8655\u7406\u8173\u672c\uff0c\u4e00\u6b21\u6027\u5c0d\u591a\u500b\u5132\u5b58\u5728list.txt\u4e2d\u7684\u7db2\u76e4\u5730\u5740\u9032\u884c\u4e0b\u8f09\u3002<\/p>\n<p>1\u3001windows\u4e0b\u7684powershell\u4e2d\u4f7f\u7528\u7684\u6279\u8655\u7406\uff1a<\/p>\n<blockquote>\n<p><small># \u6aa2\u67e5 list.txt \u662f\u5426\u5b58\u5728<\/small><br \/>\n<small>if (-Not (Test-Path &quot;list.txt&quot;)) {<\/small><br \/>\n<small>Write-Host &quot;list.txt \u6587\u4ef6\u4e0d\u5b58\u5728\u3002\u8acb\u6aa2\u67e5\u5f8c\u91cd\u8a66\u3002&quot;<\/small><br \/>\n<small>exit 1<\/small><br \/>\n<small>}<\/small><\/p>\n<p><small># \u5275\u5efa\u6216\u6e05\u7a7a log.txt<\/small><br \/>\n<small>Out-File -FilePath &quot;log.txt&quot; -Encoding UTF8<\/small><\/p>\n<p><small># \u8b80\u53d6 list.txt \u4e2d\u7684 URL<\/small><br \/>\n<small>Get-Content &quot;list.txt&quot; | ForEach-Object {<\/small><br \/>\n<small>$url = $_.Trim()  # \u79fb\u9664\u7a7a\u767d\u5b57\u7b26<\/small><br \/>\n<small>if ($url -ne &quot;&quot;) {<\/small><br \/>\n<small>Write-Host &quot;\u958b\u59cb\u4e0b\u8f09\uff1a$url&quot;<\/small><\/p>\n<p><small># \u8a18\u9304\u958b\u59cb\u6642\u9593<\/small><br \/>\n<small>$startTime = Get-Date<\/small><\/p>\n<p><small>try {<\/small><br \/>\n<small># \u4f7f\u7528 python -m gfile \u4f86\u57f7\u884c<\/small><br \/>\n<small>&amp; &quot;python&quot; -m gfile download $url<\/small><\/p>\n<p><small>$endTime = Get-Date<\/small><br \/>\n<small>$duration = $endTime &#8211; $startTime<\/small><\/p>\n<p><small># \u5beb\u5165\u65e5\u5fd7<\/small><br \/>\n<small>Add-Content -Path &quot;log.txt&quot; -Value &quot;URL: $url&quot;<\/small><br \/>\n<small>Add-Content -Path &quot;log.txt&quot; -Value &quot;\u958b\u59cb\u6642\u9593: $startTime, \u7d50\u675f\u6642\u9593: $endTime, \u7528\u6642: $duration&quot;<\/small><br \/>\n<small>Add-Content -Path &quot;log.txt&quot; -Value &quot;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&quot;<\/small><\/p>\n<p><small>Write-Host &quot;\u5b8c\u6210\u4e0b\u8f09\uff1a$url&quot;<\/small><br \/>\n<small>} catch {<\/small><br \/>\n<small>Add-Content -Path &quot;log.txt&quot; -Value &quot;\u4e0b\u8f09\u5931\u6557: $url &#8211; \u932f\u8aa4\u4fe1\u606f: <span class=\"math\">\\((\\)<\/span>_.Exception.Message)&quot;<\/small><br \/>\n<small>Write-Host &quot;\u4e0b\u8f09\u5931\u6557\uff1a$url&quot;<\/small><br \/>\n<small>}<\/small><br \/>\n<small>}<\/small><br \/>\n<small>}<\/small><\/p>\n<p><small>Write-Host &quot;\u6240\u6709\u4e0b\u8f09\u5df2\u5b8c\u6210\uff0c\u8acb\u6aa2\u67e5 log.txt \u6587\u4ef6\u3002&quot;<\/small><\/p>\n<\/blockquote>\n<p>2\u3001windows\u4e0b\u7684powershell\u4e2d\u4f7f\u7528\u7684\u6279\u8655\u7406\uff08\u589e\u52a0\u4f7f\u7528\u4ee3\u7406\u670d\u52d9\u5668\u8a2a\u554f\u7684\u529f\u80fd\uff09\uff1a<\/p>\n<blockquote>\n<p><small># \u6aa2\u67e5 list.txt \u662f\u5426\u5b58\u5728<\/small><br \/>\n<small>if (-Not (Test-Path &quot;list.txt&quot;)) {<\/small><br \/>\n<small>Write-Host &quot;list.txt \u6587\u4ef6\u4e0d\u5b58\u5728\u3002\u8acb\u6aa2\u67e5\u5f8c\u91cd\u8a66\u3002&quot;<\/small><br \/>\n<small>exit 1<\/small><br \/>\n<small>}<\/small><\/p>\n<p><small># \u8a2d\u7f6e SOCKS5 \u4ee3\u7406<\/small><br \/>\n<small>$env:ALL_PROXY = &quot;socks5:\/\/127.0.0.1:3333&quot;<\/small><\/p>\n<p><small># \u5275\u5efa\u6216\u6e05\u7a7a log.txt<\/small><br \/>\n<small>Out-File -FilePath &quot;log.txt&quot; -Encoding UTF8<\/small><\/p>\n<p><small># \u8b80\u53d6 list.txt \u4e2d\u7684 URL<\/small><br \/>\n<small>Get-Content &quot;list.txt&quot; | ForEach-Object {<\/small><br \/>\n<small>$url = $_.Trim()  # \u79fb\u9664\u7a7a\u767d\u5b57\u7b26<\/small><br \/>\n<small>if ($url -ne &quot;&quot;) {<\/small><br \/>\n<small>Write-Host &quot;\u958b\u59cb\u4e0b\u8f09\uff1a$url&quot;<\/small><\/p>\n<p><small># \u8a18\u9304\u958b\u59cb\u6642\u9593<\/small><br \/>\n<small>$startTime = Get-Date<\/small><\/p>\n<p><small>try {<\/small><br \/>\n<small># \u4f7f\u7528 python -m gfile \u4f86\u57f7\u884c<\/small><br \/>\n<small>&amp; &quot;python&quot; -m gfile download $url<\/small><\/p>\n<p><small>$endTime = Get-Date<\/small><br \/>\n<small>$duration = $endTime &#8211; $startTime<\/small><\/p>\n<p><small># \u5beb\u5165\u65e5\u5fd7<\/small><br \/>\n<small>Add-Content -Path &quot;log.txt&quot; -Value &quot;URL: $url&quot;<\/small><br \/>\n<small>Add-Content -Path &quot;log.txt&quot; -Value &quot;\u958b\u59cb\u6642\u9593: $startTime, \u7d50\u675f\u6642\u9593: $endTime, \u7528\u6642: $duration&quot;<\/small><br \/>\n<small>Add-Content -Path &quot;log.txt&quot; -Value &quot;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&quot;<\/small><\/p>\n<p><small>Write-Host &quot;\u5b8c\u6210\u4e0b\u8f09\uff1a$url&quot;<\/small><br \/>\n<small>} catch {<\/small><br \/>\n<small>Add-Content -Path &quot;log.txt&quot; -Value &quot;\u4e0b\u8f09\u5931\u6557: $url &#8211; \u932f\u8aa4\u4fe1\u606f: <span class=\"math\">\\((\\)<\/span>_.Exception.Message)&quot;<\/small><br \/>\n<small>Write-Host &quot;\u4e0b\u8f09\u5931\u6557\uff1a$url&quot;<\/small><br \/>\n<small>}<\/small><br \/>\n<small>}<\/small><br \/>\n<small>}<\/small><\/p>\n<p><small>Write-Host &quot;\u6240\u6709\u4e0b\u8f09\u5df2\u5b8c\u6210\uff0c\u8acb\u6aa2\u67e5 log.txt \u6587\u4ef6\u3002&quot;<\/small><\/p>\n<p>3\u3001\u5728linux\u7cfb\u7d71\u4e0b\u7684sh\u8173\u672c\uff1a<\/p>\n<p><small>#!\/bin\/bash<\/small><\/p>\n<p><small># \u78ba\u4fdd\u8173\u672c\u9047\u5230\u932f\u8aa4\u6642\u9000\u51fa<\/small><br \/>\n<small>set -e<\/small><\/p>\n<p><small># \u6aa2\u67e5 list.txt \u662f\u5426\u5b58\u5728<\/small><br \/>\n<small>if [ ! -f &quot;list.txt&quot; ]; then<\/small><br \/>\n<small>echo &quot;list.txt \u6587\u4ef6\u4e0d\u5b58\u5728\u3002\u8acb\u6aa2\u67e5\u5f8c\u91cd\u8a66\u3002&quot;<\/small><br \/>\n<small>exit 1<\/small><br \/>\n<small>fi<\/small><\/p>\n<p><small># \u5275\u5efa\u6216\u6e05\u7a7a log.txt<\/small><br \/>\n<small>&gt; log.txt<\/small><\/p>\n<p><small># \u9010\u884c\u8b80\u53d6 list.txt \u4e2d\u7684 URL<\/small><br \/>\n<small>while IFS= read -r url; do<\/small><br \/>\n<small># \u5ffd\u7565\u7a7a\u884c\u548c\u4ee5 # \u958b\u982d\u7684\u884c<\/small><br \/>\n<small>if [[ -z &quot;$url&quot; || &quot;$url&quot; =~ ^# ]]; then<\/small><br \/>\n<small>continue<\/small><br \/>\n<small>fi<\/small><\/p>\n<p><small>echo &quot;\u958b\u59cb\u4e0b\u8f09\uff1a$url&quot;<\/small><\/p>\n<p><small># \u8a18\u9304\u958b\u59cb\u6642\u9593<\/small><br \/>\n<small>start_time=$(date &#8216;+%Y-%m-%d %H:%M:%S&#8217;)<\/small><br \/>\n<small>start_epoch=$(date &#8216;+%s&#8217;)<\/small><\/p>\n<p><small># \u57f7\u884c\u4e0b\u8f09<\/small><br \/>\n<small>gfile download &quot;$url&quot;<\/small><\/p>\n<p><small># \u8a18\u9304\u7d50\u675f\u6642\u9593<\/small><br \/>\n<small>end_time=$(date &#8216;+%Y-%m-%d %H:%M:%S&#8217;)<\/small><br \/>\n<small>end_epoch=$(date &#8216;+%s&#8217;)<\/small><\/p>\n<p><small># \u8a08\u7b97\u7528\u6642<\/small><br \/>\n<small>duration=$((end_epoch &#8211; start_epoch))<\/small><\/p>\n<p duration=\"\"><small># \u5beb\u5165\u65e5\u5fd7<\/small><br \/>\n<small>echo &quot;URL: $url&quot; &gt;&gt; log.txt<\/small><br \/>\n<small>echo &quot;\u958b\u59cb\u6642\u9593: $start_time, \u7d50\u675f\u6642\u9593: $end_time, \u7528\u6642: $\u79d2&quot; &gt;&gt; log.txt<\/small><br \/>\n<small>echo &quot;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&quot; &gt;&gt; log.txt<\/small><\/p>\n<p><small>echo &quot;\u5b8c\u6210\u4e0b\u8f09\uff1a$url&quot;<\/small><br \/>\n<small>done &lt; &quot;list.txt&quot;<\/small><\/p>\n<p><small>echo &quot;\u6240\u6709\u4e0b\u8f09\u5df2\u5b8c\u6210\uff0c\u8acb\u6aa2\u67e5 log.txt \u6587\u4ef6\u3002&quot;<\/small><\/p>\n<\/blockquote>\n<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1a<a href=\"https:\/\/keyi.eu.org\">\u5218\u592a\u76d1\u7684\u79c1\u85cf<\/a> &raquo; <a href=\"https:\/\/keyi.eu.org\/?p=909\">gigafile\u6279\u91cf\u4e0b\u8f09\u8173\u672c<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u524d\u9762\u4e00\u6587\u6240\u63a8\u85a6\u7684gigafile\u7db2\u76e4\u547d\u4ee4\u884c\u5f0f\u64cd\u4f5c\u8173\u672c\uff08https:\/\/keyi.eu.org\/?p=904\uff09 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/keyi.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/909"}],"collection":[{"href":"https:\/\/keyi.eu.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/keyi.eu.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/keyi.eu.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/keyi.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=909"}],"version-history":[{"count":1,"href":"https:\/\/keyi.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/909\/revisions"}],"predecessor-version":[{"id":910,"href":"https:\/\/keyi.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/909\/revisions\/910"}],"wp:attachment":[{"href":"https:\/\/keyi.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/keyi.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/keyi.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}