Cheat on download with ?preview=true
This commit is contained in:
2
main.py
2
main.py
@@ -9,6 +9,7 @@ import logging
|
|||||||
from boxsdk import Client
|
from boxsdk import Client
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from src.customBoxFile import CustomBoxFile
|
||||||
from src.job import Job
|
from src.job import Job
|
||||||
from src.setup import setup_logger
|
from src.setup import setup_logger
|
||||||
from src.auth_helper import init_oauth
|
from src.auth_helper import init_oauth
|
||||||
@@ -28,6 +29,7 @@ def main():
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
client = Client(init_oauth())
|
client = Client(init_oauth())
|
||||||
|
client.translator.register('file', CustomBoxFile)
|
||||||
q = queue.Queue()
|
q = queue.Queue()
|
||||||
|
|
||||||
if args.itemId is not None:
|
if args.itemId is not None:
|
||||||
|
|||||||
6
src/customBoxFile.py
Normal file
6
src/customBoxFile.py
Normal file
@@ -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'
|
||||||
Reference in New Issue
Block a user