Skip to content

Instantly share code, notes, and snippets.

View liiight's full-sized avatar

Or Carmi liiight

View GitHub Profile
@liiight
liiight / awsaio_poc.py
Created September 22, 2020 21:46
two_progress_bars
def download_data(s3_keys: List[Tuple[str, int]], total_size: int):
size_progress = Progress(
"{task.description}",
TextColumn("[bold blue]{task.fields[key]}", justify="right"),
BarColumn(),
DownloadColumn(),
TransferSpeedColumn(),
TimeRemainingColumn(),
)
keys_progress = Progress("{task.description}", BarColumn(), "{task.completed} of {task.total}")
@liiight
liiight / argparse_bot.py
Created August 28, 2016 09:53
Argparse Telegram bot
import argparse
from telegram.ext import Updater
from telegram.ext.commandhandler import CommandHandler
import logging
# Enable logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
@liiight
liiight / test_trakt_list.py
Created March 17, 2016 15:54
attempt at trakt set test
from __future__ import unicode_literals, division, absolute_import
import pytest
from flexget.entry import Entry
from flexget.plugins.list.trakt_list import TraktSet
@pytest.mark.online
class TestTraktList(object):
@liiight
liiight / lazy_shrike.py
Created February 15, 2016 08:48
Delete stale movies by age
import requests
from datetime import datetime
from dateutil import parser
from dateutil.relativedelta import relativedelta
host = '<HOST NAME>'
port = 7171
token = '<USER TOKEN>'
get_movies_endpoint = '/api/movie_queue/?page=1&max=1000&queue_name=default&is_downloaded=false&sort_by=added&order=desc'
from __future__ import unicode_literals, division, absolute_import
import logging
import re
from jsonschema.compat import str_types
from flexget import plugin
from flexget.event import event
from flexget.entry import Entry
from imdb import IMDb
@liiight
liiight / irc.py
Last active August 29, 2015 14:27
from __future__ import unicode_literals, division, absolute_import
import re
import socket
import threading
from flexget.entry import Entry
import xml.etree.ElementTree as ET
import logging
from flexget.config_schema import register_config_key, format_checker
@liiight
liiight / couchpotato.py
Created July 29, 2015 06:44
couchpotato.py
from __future__ import unicode_literals, division, absolute_import
from urlparse import urlparse
import logging
import requests
from flexget import plugin
from flexget.event import event
from flexget.entry import Entry
from flexget.utils import qualities
from requests import RequestException