aboutsummaryrefslogtreecommitdiffstats
path: root/uncompressed/googledrive/index.js
diff options
context:
space:
mode:
authorLibravatar Mahadevan Sreenivasan <mahadevan_sv@yahoo.com>2020-05-27 09:40:17 +0530
committerLibravatar Sampath Kumar Krishnan <sampathBlam@users.noreply.github.com>2020-05-27 09:40:46 +0530
commitda05bb8f15eb8a50c2bda4ef417b3c38c162d189 (patch)
treed79c686196089ca23c63e6c94bf12cd79e00b9cd /uncompressed/googledrive/index.js
parentPackage recipe (diff)
downloadferdium-recipes-da05bb8f15eb8a50c2bda4ef417b3c38c162d189.tar.gz
ferdium-recipes-da05bb8f15eb8a50c2bda4ef417b3c38c162d189.tar.zst
ferdium-recipes-da05bb8f15eb8a50c2bda4ef417b3c38c162d189.zip
fix: Update request headers for Google drive recipe
- Add user-agent and origin request headers - Update icon.png Co-Authored-By: Sampath Kumar Krishnan<sampathblam@users.noreply.github.com>
Diffstat (limited to 'uncompressed/googledrive/index.js')
-rw-r--r--uncompressed/googledrive/index.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/uncompressed/googledrive/index.js b/uncompressed/googledrive/index.js
index 9c4da64..aacc1ac 100644
--- a/uncompressed/googledrive/index.js
+++ b/uncompressed/googledrive/index.js
@@ -2,10 +2,17 @@ var os = require('os')
2 2
3module.exports = Franz => 3module.exports = Franz =>
4 class googledrive extends Franz { 4 class googledrive extends Franz {
5 overrideUserAgent() { 5 modifyRequestHeaders() {
6 if (os.platform() == 'linux') 6 return [
7 return "Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0" 7 {
8 else 8 headers: {
9 return "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0"; 9 'user-agent': window.navigator.userAgent.replace(/(Ferdi|Electron)\/\S+ \([^)]+\)/g, '').trim(),
10 'origin': 'https://drive.google.com'
11 },
12 requestFilters: {
13 urls: ['*://*/*'],
14 },
15 },
16 ];
10 } 17 }
11 }; 18 };