Skip to content

Instantly share code, notes, and snippets.

@tonytonyjan
Last active December 17, 2015 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonytonyjan/5546352 to your computer and use it in GitHub Desktop.
Save tonytonyjan/5546352 to your computer and use it in GitHub Desktop.
Retrieve download URL from YouTube.
  1. Go to YouTube to find the video that you want to download.
  2. Copy the script to your browser navigation bar, then you'll get the download URL.
  3. You can save it to your bookmark.

Note: This script does not support HTML5 player since it's much easier to retrieve the source URL by viewing the source page.

  1. 到 YouTube 瀏覽你要下載的的影片網址。
  2. 將程式碼貼到網址列上(含前面的 javascript:),你將得到一個載點。
  3. 你可以將此程式碼存到你的書籤。

注意:這個腳本不支援 HTML5 播放器,因為透過檢視原始碼即可輕易取得原始載點。

javascript:(function(){function params_to_obj(string){return JSON.parse('{"'+string.replace(/&/g,"\",\"").replace(/=/g,"\":\"")+'"}')} obj = params_to_obj(decodeURIComponent(params_to_obj(document.getElementById('movie_player').getAttribute('flashvars')).url_encoded_fmt_stream_map).split(',')[0]);alert(decodeURIComponent(obj.url)+'&signature='+obj.sig);}).call();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment