
我知道在 Windows 中,Internet Explorer在觀看 YouTube 時.flv
將臨時檔案儲存在臨時資料夾 ( ) 中。C:\Users\%username%\AppData\Local\Microsoft\Windows\Temporary Internet Files
且 Windows 中的 Google Chrome 品牌相同 ( C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Cache
)。因此很容易找到該.flv
文件的副本。
Ubuntu 中的 Chrom 怎麼樣?它是否儲存瀏覽臨時資料以及在哪裡?
答案1
我做了一些研究,現在我得到的答案並不像乍看那麼簡單。
我在谷歌上搜尋了很多,幾乎所有內容都指向該~/.cache/chromium/Default
資料夾。您應該在該資料夾中找到 google chrome 的快取檔案。但沒有大型的 Flash 影片檔(像 YouTube 那樣),只有小檔案。
最後,為了回答這個問題,我得出以下結論:
- 首先,您必須打開 YouTube 影片並讓它從網路串流。
- 在終端機 ( ++ Ctrl)中,您應該會取得使用 Flash Player 外掛程式的 Chromium 的 PID。您可以使用各種命令,但效果很好:。AltT
ps
ps ax | grep flash
獲得此 PID 後,您可以找到剛剛在 Youtube 上串流的影片檔案的名稱:
ls -l /proc/[*PID*]/fd | grep Flash
。你會看到這樣的結果:lrwx------ 1 [*user*] [*user*] 64 mai 2 09:48 [*video file name - is a number*] -> /tmp/FlashXX4PeKRY (deleted)`
這是問題的答案:在 YouTube 上傳輸並緩存在系統上的最後一個視訊檔案是:
/proc/[*PID*]/fd/[*video file name - is a number*]
現在,如果需要,您應該將它們複製到系統上的任何位置:
cp /proc/[*PID*]/fd/[*video file name - is a number*] ~/Videos/[*new video file name*].flv
現在,您的個人影片收藏中已在 Youtube 上觀看了最後一個影片。
答案2
我寫了一個小的 bash 腳本,可以自動執行出色的操作解決方案從拉杜:
#!/bin/bash
pidNum=$(ps ax | grep flash | grep chromium | grep -v "grep" | sed -e 's/^ *//g' -e 's/ *$//g' | tr -s " " | cut -d " " -f 1)
procNum=$(ls -l /proc/${pidNum}/fd | grep Flash | tr -s " " | cut -d " " -f 9)
filename=$1
if [[ "$filename" == "" ]]; then
filename=$procNum
fi
echo "Copying /proc/${pidNum}/fd/${procNum} to '${filename}.flv'"
cp /proc/${pidNum}/fd/${procNum} "${filename}.flv"
ls -lah "${filename}.flv"
答案3
我像這樣手動執行此操作:在 /etc/bash.bashrc 中定義此別名
alias findflash='find /proc/ -maxdepth 1 -type d -exec lsfd.sh {} \;'
並在 /usr/local/bin/lsfd.sh 中建立此腳本
#!/bin/bash
ls -l $1/fd/ 2>/dev/null 3>/dev/null| grep -i 'flash' 1>/dev/null 2>/dev/null 3>/dev/null;
if [ $? -eq "0" ];
then
echo $1/fd/;
ls -l $1/fd/ | grep -i 'flash';
fi
結果:
root@juanmf-V570:/tmp# findflash
/proc/31591/fd/
lrwx------ 1 root root 64 Aug 19 23:59 37 -> /home/juanmf/.config/google-chrome/Default/Pepper Data/Shockwave Flash/.com.google.Chrome.9Oc0fE (deleted)
lrwx------ 1 root root 64 Aug 19 23:59 38 -> /home/juanmf/.config/google-chrome/Default/Pepper Data/Shockwave Flash/.com.google.Chrome.hcEvxv (deleted)
然後我就知道檔案在哪裡,並使用 mplayer 來查看我想要的檔案。然後手動複製。
答案4
我編寫了新的 bash 腳本來使用下載 flash 影片文件ubuntu 16.04和鉻版本 62。謝謝這個例子從 麥克巴倫
#!/bin/bash echo“正在抓取Flash檔。” getPidNum=$(lsof | grep Flash | grep 刪除 | tr -s " " | cut -d " " -f 2) pid號=“” 對於 ${getPidNum} 中的 linePidNum;做 if [[ "$pidNum" != "$linePidNum" ]];然後 pidNum=$linePidNum echo "PID號碼是${pidNum}" getProcNum=$(ls -l /proc/${pidNum}/fd | grep Flash | tr -s " " | cut -d " " -f 9) 進程號=“” 對於 ${getProcNum} 中的 lineProcNum;做 if [[ "$procNum" != "$lineProcNum" ]];然後 procNum=$lineProcNum echo "檔案號碼是${procNum}" echo "正在將 /proc/${pidNum}/fd/${procNum} 複製到 '${procNum}.flv'" cp /proc/${pidNum}/fd/${procNum} "${procNum}.flv" 菲 完畢 菲 完畢