This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import subprocess | |
import argparse | |
import os | |
if os.system('which ffmpeg') != 0: | |
print('Please install ffmpeg before using this script') | |
print('sudo apt install ffmpeg') | |
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import re | |
import requests | |
import os | |
import argparse | |
ap = argparse.ArgumentParser() | |
ap.add_argument('URL', help='URL to download files') | |
ap.add_argument('regex', help='Regex to detect the subdirectories in html') | |
ap.add_argument("-d", "--directory", help="Directory", default=os.getcwd() + os.sep) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dict_to_Q(filters_dict, valid_fields_operations=None, prefix=''): | |
""" | |
Converts a dictionary to Q filter object | |
Args: | |
filters_dict (dict): | |
Must contain fields, filter lookups and values. | |
Example: {'ts__gte': '2020-10-12', ...} | |
valid_fields_operations (dict, optional): | |
Mapping for valid field names and corresponding filter lookups. | |
Defaults to None : doesn't verify validity (insecure) |