From 7ed67ab7c4292299b6916c567249e0e627971f7a Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 28 Sep 2019 23:40:16 +0100 Subject: [PATCH] Cheat on download with ?preview=true --- main.py | 2 ++ src/customBoxFile.py | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 src/customBoxFile.py diff --git a/main.py b/main.py index 3b8833e..8ce5536 100644 --- a/main.py +++ b/main.py @@ -9,6 +9,7 @@ import logging from boxsdk import Client from pathlib import Path +from src.customBoxFile import CustomBoxFile from src.job import Job from src.setup import setup_logger from src.auth_helper import init_oauth @@ -28,6 +29,7 @@ def main(): args = parser.parse_args() client = Client(init_oauth()) + client.translator.register('file', CustomBoxFile) q = queue.Queue() if args.itemId is not None: diff --git a/src/customBoxFile.py b/src/customBoxFile.py new file mode 100644 index 0000000..394d133 --- /dev/null +++ b/src/customBoxFile.py @@ -0,0 +1,6 @@ +from boxsdk.object.file import File + + +class CustomBoxFile(File): + def get_url(self, *args): + return super().get_url(*args) + '?preview=true'