Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import json
import time
import requests_mock
import glob
from logging import Logger
from tubeup.TubeUp import TubeUp, DOWNLOAD_DIR_NAME
from tubeup.utils import LogErrorToStdout
from youtube_dl import YoutubeDL
from .constants import info_dict_playlist, info_dict_video
current_path = os.path.dirname(os.path.realpath(__file__))
INTERNET_ARCHIVE_VERSION = 'Internet Archive Python library {0}'.format(
internetarchive.__version__)
def get_testfile_path(name):
return os.path.join(current_path, 'test_tubeup_files', name)
def mocked_ydl_progress_hook(d):
pass
def mock_upload_response_by_videobasename(m, ia_id, videobasename):
files_to_upload = glob.glob(videobasename + '*')
for file_path in files_to_upload:
filename = os.path.basename(file_path)
m.put('https://s3.us.archive.org/%s/%s' % (ia_id, filename),