How to use the ytcc.core.Ytcc function in ytcc

To help you get started, we’ve selected a few ytcc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github woefe / ytcc / test / test_ytcc.py View on Github external
def setUp(self):
        self.current_dir = os.path.dirname(__file__)
        self.ytcc = Ytcc(os.path.join(self.current_dir, "data/ytcc_test.conf"))
        self.db_conn = self.ytcc.database

        insert_list = [
            Video(yt_videoid="V-ozGFl3Jks", title="tmptYnCut", description="",
                 publisher="UCsLiV4WJfkTEHH0b9PmRklw", publish_date=1488348731.0, watched=True),
            Video(yt_videoid="a1gOeiyIqPs", title="tmp99Yc1l", description="",
                 publisher="UCsLiV4WJfkTEHH0b9PmRklw", publish_date=1488348519.0, watched=True),
            Video(yt_videoid="0ounUgOrcqo", title="tmppfXKp6", description="",
                 publisher="UCsLiV4WJfkTEHH0b9PmRklw", publish_date=1488345630.0, watched=True),
            Video(yt_videoid="7mckB-NdKWY", title="tmpiM62pN", description="",
                 publisher="UCsLiV4WJfkTEHH0b9PmRklw", publish_date=1488345565.0, watched=False),
            Video(yt_videoid="RmRPt93uAsQ", title="tmpIXBgjd", description="",
                 publisher="UCsLiV4WJfkTEHH0b9PmRklw", publish_date=1488344217.0, watched=False),
            Video(yt_videoid="nDPy3RyKdrg", title="tmpwA0TjG", description="",
                 publisher="UCsLiV4WJfkTEHH0b9PmRklw", publish_date=1488343000.0, watched=False),
            Video(yt_videoid="L0_F805qUIM", title="tmpKDOkro", description="",
github woefe / ytcc / test / test_ytcc.py View on Github external
def setUp(self):
        self.current_dir = os.path.dirname(__file__)
        self.ytcc = Ytcc(os.path.join(self.current_dir, "data/ytcc_test.conf"))
        self.db_conn = self.ytcc.database
github woefe / ytcc / test / test_ytcc.py View on Github external
def setUp(self):
        self.current_dir = os.path.dirname(__file__)
        self.ytcc = Ytcc(os.path.join(self.current_dir, "data/ytcc_test.conf"))
        self.db_conn = self.ytcc.database
        self.db_conn.engine.execute("delete from video")
        self.db_conn.engine.execute("delete from channel")
        self.db_conn.add_channel(Channel(displayname="Webdriver Torso", yt_channelid="UCsLiV4WJfkTEHH0b9PmRklw"))
        self.db_conn.add_channel(Channel(displayname="Webdriver YPP", yt_channelid="UCxexYYtOetqikZqriLuTS-g"))
github woefe / ytcc / ytcc / cli.py View on Github external
import signal
import textwrap as wrap
from datetime import datetime
from enum import Enum
from typing import List, Iterable, Optional, TextIO, Any, Set, Tuple, Callable, NamedTuple, Dict, \
    BinaryIO

from ytcc import core, arguments, terminal, _
from ytcc.database import Video
from ytcc.exceptions import BadConfigException, ChannelDoesNotExistException, \
    DuplicateChannelException, BadURLException, DatabaseOperationalError
from ytcc.terminal import printt, printtln
from ytcc.utils import unpack_optional

try:
    ytcc_core = core.Ytcc()  # pylint: disable=C0103
    COLUMN_FILTER = [ytcc_core.config.table_format.getboolean("ID"),
                     ytcc_core.config.table_format.getboolean("Date"),
                     ytcc_core.config.table_format.getboolean("Channel"),
                     ytcc_core.config.table_format.getboolean("Title"),
                     ytcc_core.config.table_format.getboolean("URL"),
                     ytcc_core.config.table_format.getboolean("Watched")]
    COLORS = ytcc_core.config.color
except BadConfigException:
    print(_("The configuration file has errors!"))
    sys.exit(1)

INTERACTIVE_ENABLED = True
DESCRIPTION_ENABLED = True
NO_VIDEO = False
DOWNLOAD_PATH = ""
HEADER_ENABLED = True