Google Drive | wget copy&paste command creator - EN Version

A easy tool to use to use your terminal to download your files from Google Drive!

  1. // ==UserScript==
  2. // @name Google Drive | wget copy&paste command creator - EN Version
  3. // @namespace http://tampermonkey.net/
  4. // @version Final-2021
  5. // @description A easy tool to use to use your terminal to download your files from Google Drive!
  6. // @author xAlcahest
  7. // @match https://drive.google.com/file/d/*
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
  9. // @grant GM_setClipboard
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. var url_parttens = window.location.href.split('/');
  15. var file_id = url_parttens[url_parttens.length - 2]
  16. var file_name = jQuery("meta[property='og:title']").attr("content");
  17. var command = `wget --load-cookies cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=${file_id}' ` + "-O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\\1\\n/p')&id=" + `${file_id}" -O ${file_name} && rm -rf cookies.txt`;
  18. GM_setClipboard(command);
  19. alert('The [wget] command is ready, the command has been automatically copied to the clipboard.')
  20. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址