Giter Site home page Giter Site logo

woefe / ytcc Goto Github PK

View Code? Open in Web Editor NEW
174.0 9.0 20.0 533 KB

Command line tool to keep track of your favorite playlists on YouTube and many other places.

License: GNU General Public License v3.0

Python 93.63% Shell 6.37%
youtube video mpv command-line youtube-dl python3

ytcc's Introduction

ytcc

Build and test

Command line tool to keep track of your favorite playlists on YouTube and many other places.

Installation

pip install ytcc

Alternative installation methods are described in the documentation.

Usage

Add "subscriptions".

# Any playlist supported by yt-dlp (or youtube-dl)
ytcc subscribe "Jupiter Broadcasting" "https://www.youtube.com/c/JupiterBroadcasting/videos"
ytcc subscribe "NCS: House" "https://www.youtube.com/playlist?list=PLRBp0Fe2GpgmsW46rJyudVFlY6IYjFBIK"
ytcc subscribe "Neus" "https://soundcloud.com/neus/tracks"

# RSS feed podcasts
ytcc subscribe "LINUX Unplugged" "https://linuxunplugged.com/rss"
ytcc subscribe "Darknet Diaries" "https://feeds.megaphone.fm/darknetdiaries"

Import subscriptions from Google Takeout. Hint: When requesting a takeout make sure to select only the YouTube data, otherwise the takeout might take quite long to complete.

ytcc import ~/Downloads/Takeout/Youtube/subscriptions/subscriptions.csv

Fetch metadata of new videos.

ytcc update

List unwatched videos.

ytcc list

List playlist content in JSON format.

ytcc --output json list --playlist "NCS: House" --since 2020-07-07 --watched --unwatched

List all videos as RSS feed.

ytcc --output rss list --watched --unwatched

Start the interactive terminal interface.

ytcc tui

Mark all videos of a playlist as watched without playing them.

ytcc ls -p "Jupiter Broadcasting" | ytcc mark

Listen to some music without limitations.

ytcc ls -p "NCS: House" | ytcc play --audio-only

Alternative terminal interface with thumbnail support. Requires fzf version 0.23.1 or newer, optionally curl and either ueberzug or kitty. The script is automatically installed on most platforms during installation of ytcc. If it's not installed, you can download it from here.

ytccf.sh

# Show help and key bindings
ytccf.sh --help

Configuration

Ytcc searches for a configuration file at following locations:

  1. The file given with -c or --config options
  2. ~/.ytcc.conf
  3. $XDG_CONFIG_HOME/ytcc/ytcc.conf or ~/.config/ytcc/ytcc.conf
  4. /etc/ytcc/ytcc.conf

If no config file is found in these locations, a default config file is created at $XDG_CONFIG_HOME/ytcc/ytcc.conf or ~/.config/ytcc/ytcc.conf

Example config

[ytcc]

# Directory where downloads are saved, when --path is not given
download_dir = ~/Downloads

# Downloads videos to subdirectories by playlist name. If a video is on multiple playlists, ytcc
# will download the video only to one subdirectory and symlink it to the other subdirectories.
download_subdirs = on

# Parameters passed to mpv. Adjusting these might break video playback in ytcc!
mpv_flags = --ytdl --ytdl-format=bestvideo[height<=?1080]+bestaudio/best

# Defines the order of video listings.
# Possible options: id, url, title, description, publish_date, watched, duration, extractor_hash,
# playlists. Every option must be suffixed with :desc or :asc for descending or ascending sort.
order_by = playlists:asc, publish_date:desc

# Default attributes shown in video listings.
# Some ytcc commands allow overriding the default set here in the config.
video_attrs = id, title, publish_date, duration, playlists

# Default attributes shown in playlist/subscription listings.
# Some ytcc commands allow overriding the default set here in the config.
playlist_attrs = name, url, reverse, tags

# Path where the database is stored.
# Can be used to sync the database between multiple machines.
db_path = ~/.local/share/ytcc/ytcc.db

# The format of used to print dates
date_format = %Y-%m-%d

# Default failure threshold before a video is ignored.
# When a video could not be updated repeatedly, it will be ignored by ytcc after `max_update_fail`
# attempts. This setting can be overridden with the --max-fail commandline parameter.
max_update_fail = 5

# Default update backlog.
# The update command will only check the first `max_update_backlog` videos of a playlist to improve
# performance. This setting can be overridden with the --max-backlog commandline parameter.
max_update_backlog = 20

# Ignore videos that have an age limit higher than the one specified here.
age_limit = 0


# Prompt and table colors. Supports 256 colors. Hence, values between 0-255 are allowed.
# See https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit for the color codes.
[theme]
prompt_download_audio = 2
prompt_download_video = 4
prompt_play_audio = 2
prompt_play_video = 4
prompt_mark_watched = 1
table_alternate_background = 245
plain_label_text = 244


[tui]
# The characters to use for selecting videos in interactive mode.
alphabet = sdfervghnuiojkl

# Default action of interactive mode.
# Possible options: play_video, play_audio, mark_watched, download_audio, download_video
default_action = play_video


[youtube_dl]
# Format (see FORMAT SELECTION in yt-dlp manpage). Make sure to use a video format here, if you
# want to be able to download videos.
format = bestvideo[height<=?1080]+bestaudio/best

# Output template (see OUTPUT TEMPLATE in yt-dlp manpage).
# Note that the output template will be prefixed with the `download_dir` directory and the name of
# the playlist if `download_sub_dir` is enabled.
output_template = %(title)s.%(ext)s

# If a merge is required according to format selection, merge to the given container format.
# One of mkv, mp4, ogg, webm, flv
merge_output_format = mkv

# Limit download speed to the given bytes/second. Set 0 for no limit.
# E.g. limit to one megabyte per second
#ratelimit = 1000000
ratelimit = 0

# Set number of retries before giving up on a download.
# Set 0 for no retries.
retries = 0

# Subtitles for videos.
# If enabled and available, automatic and manual subtitles for selected languages are embedded in
# the video.
#subtitles = en,de
subtitles = off

# Embed the youtube thumbnail in audio downloads.
# Transforms the resulting file to m4a, if enabled.
thumbnail = on

# Skips livestreams in download command.
skip_live_stream = true

# Don't download videos longer than 'max_duration' seconds.
# 0 disables the limit.
max_duration = 9000

# Restrict filenames to only ASCII characters and avoid "&" and spaces in filenames.
restrict_filenames = off

mpv configuration

Ytcc uses mpv to play videos. You can configure mpv to integrate nicely with ytcc. Specifics are documented here.

Reporting issues

Create a new issue on the GitHub issue tracker. Describe the issue as detailed as possible and please use the issue templates, if possible! Important: do not forget to include the output of ytcc bug-report in bug reports. It also might help a lot to run ytcc with the --loglevel debug option and include the output in your report.

Development

We recommend developing inside a virtualenv.

  1. Set up a virtualenv
  2. Install development dependencies: pip install -r devrequirements.txt

Run the following commands before every pull request and fix the warnings or errors they produce.

mypy ytcc
pytest
pylint ytcc
pydocstyle ytcc

ytcc's People

Contributors

emrowlands avatar felipeluna avatar glandos avatar gruberma avatar plct avatar vshell avatar woefe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ytcc's Issues

Show a user friendly message when the database is locked

Sometimes I have a terminal running ytcc in the background that I've forgotten about, and then I try to run another instance of ytcc and get a long complex error message. Perhaps instead ytcc should check that the database is locked and provide a user friendly message that another instance of ytcc may already be running.

Translations for v2

Translations for v2 should also use gettext as in v1. Translations should be updated and relevant strings should be translated

Feature: Option to use custom playlist name in youtube_dl output

Is your feature request related to a problem? Please describe.

Unable to use the same custom 'name' (ytcc rename) defined in ytcc as youtube_dl output.

Describe the solution you'd like

Would be great to allow the name we define in ytcc to be used as an output in the youtube_dl format option. For example instead of using something like this:

[youtube_dl]
output_template = %(uploader)s/%(title)s.%(ext)s

We can use this:

[youtube_dl]
output_template = %(ytcc_name)s/%(title)s.%(ext)s

Additional context

Would be nice to have a youtube_dl flags options the same as mpv does. Some youtubers have crazy titles (emojii's etc) so being able to pass in --restrict-filenames would be nice.

Update README.md

Update README.md for version 2

  • Update installation instructions
  • Update config options
  • Update command examples

Some fields in README config example are wrong

After trying to make outputtemplate field work, without success, I cloned the repo and realized that the expected value is output_template. I guess that merge_output_format at the beginning of [youtube_dl] section and mergeoutputformat a few lines after aren't intended too.

Steps to reproduce the behavior:

  1. Try to use the example conf in README
  2. See error with some fields

ytcc -a .... is not a valid YouTube URL

adding any channel does not work any longer:
ytcc -a "Jupiter Broadcasting" https://www.youtube.com/user/jupiterbroadcasting is not a valid YouTube URL

ytcc --bug-report-info:

`---ytcc version---
1.8.3

---youtube-dl version---
2020.06.16.1

---SQLAlchemy version---
1.3.18

---feedparser version---
5.2.1

---lxml version---
4.5.2

---python version---
3.8.3 (default, May 17 2020, 18:15:42)
[GCC 10.1.0]

---mpv version---
mpv 0.32.0 Copyright Β© 2000-2020 mpv/MPlayer/mplayer2 projects
built on UNKNOWN
ffmpeg library versions:
libavutil 56.31.100
libavcodec 58.54.100
libavformat 58.29.100
libswscale 5.5.100
libavfilter 7.57.100
libswresample 3.5.100
ffmpeg version: n4.2.3

---config dump---
[YTCC]
dbpath = ~/.local/share/ytcc/ytcc.db
downloaddir = ~/Downloads
mpvflags = --really-quiet --ytdl --ytdl-format=bestvideo[height<=?720]+bestaudio/best
alphabet = sdfervghnuiojkl
orderby = channel, date
defaultaction = play_video

[color]
promptdownloadaudio = 2
promptdownloadvideo = 4
promptplayaudio = 2
promptplayvideo = 4
promptmarkwatched = 1
tablealternatebackground = 245

[youtube-dl]
format = bestvideo[height<=?1080]+bestaudio/best
outputtemplate = %(title)s.%(ext)s
loglevel = normal
ratelimit = 0
retries = 0
subtitles = off
thumbnail = on
skiplivestream = yes
mergeoutputformat = mkv

[TableFormat]
id = on
date = off
channel = on
title = on
url = off
watched = off`

Error preventing update

Updating returns the following:

$ ytcc
Updating channels...
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/lib64/python3.5/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib64/python3.5/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/usr/lib/python3.5/site-packages/ytcc-1.5.1-py3.5.egg/ytcc/core.py", line 205, in _update_channel
    feed = feedparser.parse("https://www.youtube.com/feeds/videos.xml?channel_id=" + yt_channel_id)
  File "/usr/lib/python3.5/site-packages/feedparser.py", line 3957, in parse
    saxparser.parse(source)
  File "/usr/lib64/python3.5/site-packages/drv_libxml2.py", line 189, in parse
    eltName = (_d(reader.NamespaceUri()),\
  File "/usr/lib64/python3.5/site-packages/drv_libxml2.py", line 70, in _d
    return _decoder(s)[0]
  File "/usr/lib64/python3.5/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
TypeError: a bytes-like object is required, not 'str'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/bin/ytcc", line 4, in <module>
    __import__('pkg_resources').run_script('ytcc==1.5.1', 'ytcc')
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 724, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1657, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/lib/python3.5/site-packages/ytcc-1.5.1-py3.5.egg/EGG-INFO/scripts/ytcc", line 4, in <module>
    __import__('pkg_resources').run_script('ytcc==1.5.1', 'ytcc')
  File "/usr/lib/python3.5/site-packages/ytcc-1.5.1-py3.5.egg/ytcc/cli.py", line 510, in main
  File "/usr/lib/python3.5/site-packages/ytcc-1.5.1-py3.5.egg/ytcc/cli.py", line 493, in parse_args
  File "/usr/lib/python3.5/site-packages/ytcc-1.5.1-py3.5.egg/ytcc/cli.py", line 40, in update_all
  File "/usr/lib/python3.5/site-packages/ytcc-1.5.1-py3.5.egg/ytcc/core.py", line 221, in update_all
  File "/usr/lib64/python3.5/multiprocessing/pool.py", line 260, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/lib64/python3.5/multiprocessing/pool.py", line 608, in get
    raise self._value
TypeError: a bytes-like object is required, not 'str'

Fix cleanup command

The SQL query for the cleanup command still assumes the old schema and therefore crashes.

ytcc video resolution settings funtioning inconsistantly

First, thank you for this awesome tool and great work on it! I truly appreciate it. If I can help debugging this issue or testing changes please let me know. (I'd be happy to do so)

The issue I have is that I would like ytcc to only pull videos that are 1920 x 1080 or higher in resolution and it sometimes works, sometimes pulls 640x480 or lower.

I have had my ytcc.conf file (located in /home/user/.config/ytcc.conf) set to, 1080, 1920, etc but cannot get this to function correctly or consistently.

From ytcc.conf file...
[youtube-dl]
format = mkv/mp4/bestvideo[height>=1920]+bestaudio/best

Attached is a bug-report-info file.

ytcc-bug-report-info.txt

I would also like to know if you would be interested in a proper man page for this utility. I would gladly assist in its creation and submission to this project.

Thank you.
Pete

Filter a channels videos to download, include/exclude X

There are many channels I subscribe to that include subtopics or video series that I am not interested in.

It would be very useful to be able to add a filter to a subscribed channel in order to "include only" or "exclude all" videos matching a particular filter.

A real world example:
https://www.youtube.com/c/digikey/videos

Digikeys channel has a great series called Maker Update. I would love to be able to add this to ytcc but WITH a filter "Maker Update". Or lets say, exclude a batch of videos with "New Product" or "live" in their title.

Something that would be a partial step in that direction may be to filter/download videos by playlist. In the example above this wouldn't work because the Maker Update videos are not in a separate playlist. Additionally it would required the videos you are interested in be put into a playlist by the content creator regularly and/or consistently. (and this doesn't always happen) The ability to add a channel to ytcc but, limit it to a particular playlist would be extremely useful.

Thank you for such a handy program. I greatly appreciate it! If there is anything I can add to this (in terms of details etc) please let me know.

Path option not working.

Hi Wolfgang
Thank you very much for ytcc.
This syntax does not work (but it used to work):

ytcc --path Path --download n --channel-filter channel

Whatever the Path value, the download starts in my default download directory (XFCE , ~/Downloads)
Ditto for the -p option

$ ytcc -v
ytcc version 1.4.0

Best wishes

Duration Column

I often only have time to watch a short video, but you only see the duration after starting one. Thus i often have to cancel videos until i find a short one.

Would it be possible to add a duration column, so one could see the time needed right away?

[Enhancement] Allow choosing audio only on a per-video basis.

I'm aware I can switch ytcc to audio only using -x, but I'd like if I could choose individually for each video.

So instead of:
Play video "Level1 News December 12 2017: Yo Dawg, I Heard you Like A.I." by "Level1Techs?" [y(es)/n(o)/m(ark)/q(uit)/h(elp)] (Default: y):

It would be:
Play video "Level1 News December 12 2017: Yo Dawg, I Heard you Like A.I." by "Level1Techs?" [y(es)/n(o)/m(ark)/a(udio)/q(uit)/h(elp)] (Default: y):

This way you could simply press 'a' for audio only.

Also I just noticed that the question mark at the end is inside the quotation marks which makes it look like it's part of the channel name.

Thanks woefe for your great work on ytcc, I use it every day.

[V2] [theme] color options have no effect

Changing any of these doesn’t have an effect with V2:

[theme]
prompt_download_audio = 2
prompt_download_video = 4
prompt_play_audio = 2
prompt_play_video = 4
prompt_mark_watched = 1
table_alternate_background = 245

Migration from 1.8.4 to 2.0.1 fails... (migration script)

While following the migration instructions to migrate using the migration script, it fails...

The install using pip throws some errors but appears to function over all...

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting git+https://github.com/woefe/ytcc.git
  Cloning https://github.com/woefe/ytcc.git to /tmp/pip-req-build-y2z0ogcc
Requirement already satisfied: click in /usr/lib/python3/dist-packages (from ytcc==2.0.1) (7.0)
Collecting wcwidth (from ytcc==2.0.1)
  Downloading https://files.pythonhosted.org/packages/59/7c/e39aca596badaf1b78e8f547c807b04dae603a433d3e7a7e04d67f2ef3e5/wcwidth-0.2.5-py2.py3-none-any.whl
Requirement already satisfied: youtube_dl in /usr/local/lib/python3.7/dist-packages (from ytcc==2.0.1) (2020.12.12)
Building wheels for collected packages: ytcc
  Running setup.py bdist_wheel for ytcc ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-req-build-y2z0ogcc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-aioub81k --python-tag cp37:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
  error: invalid command 'bdist_wheel'
  
  ----------------------------------------
  Failed building wheel for ytcc
  Running setup.py clean for ytcc
Failed to build ytcc
Installing collected packages: wcwidth, ytcc
  Found existing installation: ytcc 1.8.4
    Uninstalling ytcc-1.8.4:
      Successfully uninstalled ytcc-1.8.4
  Running setup.py install for ytcc ... done
Successfully installed wcwidth-0.2.5 ytcc-2.0.1

Version appears to have been updated properly...

[pete@omv: src]$ ytcc --version
ytcc, version 2.0.1

Copyright (C) 2015-2020  Wolfgang Popp
This program comes with ABSOLUTELY NO WARRANTY; This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU General
Public Licence for details.

The migrate.py script is then run using...

python3 migrate.py --olddb ~/.local/share/ytcc/ytcc.db.v1 --newdb ~/.local/share/ytcc/ytcc.d

This also appears to complete successfully without any errors. However, when I go to run ytcc and list subscriptions... I get this...

[pete@omv: src]$ ytcc subscriptions
ERROR: This version of ytcc is not compatible with the older database versions. See https://github.com/woefe/ytcc/blob/master/doc/migrate.md for more details.

Environment, configuration and version information

[pete@omv: src]$ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
[pete@omv: src]$ uname -a
Linux omv.zhome 5.4.79-v7l+ #1373 SMP Mon Nov 23 13:27:40 GMT 2020 armv7l GNU/Linux

Bug report output

ytcc bug-report
---ytcc version---
2.0.1

---youtube-dl version---
2020.12.12

---SQLite version---
SQLite system library version: 3.27.2
Python module version: 2.6.0

---python version---
3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0]

---mpv version---
mpv 0.29.1 Copyright Β© 2000-2018 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       56.14.100 (runtime 56.22.100)
   libavcodec      58.18.100 (runtime 58.35.100)
   libavformat     58.12.100 (runtime 58.20.100)
   libswscale      5.1.100 (runtime 5.3.100)
   libavfilter     7.16.100 (runtime 7.40.101)
   libswresample   3.1.100 (runtime 3.3.100)
ffmpeg version: 4.1.6-1~deb10u1+rpt1


---config dump---
[ytcc]
download_dir = ~/Downloads
mpv_flags = --really-quiet --ytdl --ytdl-format=bestvideo[height<=?1080]+bestaudio/best
order_by = playlists:asc, publish_date:desc
video_attrs = id, title, publish_date, duration, playlists
playlist_attrs = name, url, tags
db_path = ~/.local/share/ytcc/ytcc.db
date_format = %Y-%m-%d
max_update_fail = 5
max_update_backlog = 20
age_limit = 0

[tui]
alphabet = sdfervghnuiojkl
default_action = play_video

[theme]
prompt_download_audio = 2
prompt_download_video = 4
prompt_play_audio = 2
prompt_play_video = 4
prompt_mark_watched = 1
table_alternate_background = 245

[youtube_dl]
format = bestvideo[height<=?1080]+bestaudio/best
output_template = %(title)s.%(ext)s
ratelimit = 0
retries = 0
subtitles = off
thumbnail = true
skip_live_stream = true
merge_output_format = mkv

Add scripts to showcase some of the new v2 features

Add fzf/rofi/dmenu scripts to showcase the new listing and piping feature. v2 is more unixy. In particular, the commands play, mark and download can read IDs from stdin. Example:

./ytcc.py --output table list --attributes id,title,playlists,duration | fzf | awk -F 'β”‚' '{print $1}' | ./ytcc.py  play

Categorization of video subscriptions

Sometimes I might want to watch a certain genre of YouTube subscriptions, like music, tech, news, or podcasts. It would be nice if we could categorize our subscription feeds so we could watch only what we're in the mood for.

[V2] Ability to sort video_attrs

It would be nice if the order of columns in V2 would reflect the order of this config option like in the old version:

Default:
video_attrs = id, title, publish_date, duration, playlists

Alternative order that i like:
video_attrs = playlists, title, duration, publish_date

Improve migration from v1 to v2

Migrating the entire v1 database schema is probably too much effort. Instead, it might be enough to export subscriptions with v1 and import the OPML export in v2. Problems with this first alternative:

  • User must have both v1 and v2 installed (or make an export before upgrading to v2)
  • v2 database must be at different location from v1 (that's not the case in the default config)

Second alternative: A python script (preferably without dependencies) that renames the v1 db, exports subscriptions, and re-imports them with v2. This would solve the problems of the first alternative, but is more work.

I'd love to see everyone's thoughts on this.

UTF-8 characters wider than 1 byte mess up tables

For 1 byte long characters, the tables look correct:

ASCII Title          | 
abcde                |

The | is at the same position.

But more complex UTF-8 characters mess up the space calculation:

ASCII Title          |
Title with 😁         |

It seems, due to the emoji needing 2 bytes, but actually only displaying as one byte, the calculation for the spaces is wrong. The same applies to German umlauts and other scripts like Japanese.

New channel url doesn’t get parsed

Previously, channel URLs were in the form of

https://www.youtube.com/channel/...

That seems to have been changed to:

https://www.youtube.com/c/...

Adding a channel with the new URL doesn’t resolve the playlist.

ytcc broken

Describe the bug
Archlinux updated today some python library, since then ytcc is broken

To Reproduce
any ytcc command fails with:

Traceback (most recent call last):
File "/usr/bin/ytcc", line 33, in
sys.exit(load_entry_point('ytcc==2.0.1', 'console_scripts', 'ytcc')())
File "/usr/bin/ytcc", line 22, in importlib_load_entry_point
for entry_point in distribution(dist_name).entry_points
File "/usr/lib/python3.9/importlib/metadata.py", line 524, in distribution
return Distribution.from_name(distribution_name)
File "/usr/lib/python3.9/importlib/metadata.py", line 187, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: ytcc

Expected behavior

upgraded python-click (7.1.2-1 -> 7.1.2-3)
upgraded python-setuptools (1:50.3.2-1 -> 1:50.3.2-4)
upgraded python-wcwidth (0.2.5-1 -> 0.2.5-3)

downgrading the updated python library could not solve the issue:
downgraded python-wcwidth (0.2.5-3 -> 0.2.5-1)
downgraded python-click (7.1.2-3 -> 7.1.2-1)
downgraded python-setuptools (1:50.3.2-4 -> 1:50.3.2-1)

Environment, configuration and version information

LSB_VERSION=1.4
DISTRIB_ID=Arch
DISTRIB_RELEASE=rolling
DISTRIB_DESCRIPTION="Arch Linux"

Add the output of ytcc bug-report here

ytcc bug-report
Traceback (most recent call last):
  File "/usr/bin/ytcc", line 33, in <module>
    sys.exit(load_entry_point('ytcc==2.0.1', 'console_scripts', 'ytcc')())
  File "/usr/bin/ytcc", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/lib/python3.9/importlib/metadata.py", line 524, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.9/importlib/metadata.py", line 187, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: ytcc

user agent

This is a bit trivial but it would be nice if urlopen had a popular user-agent like windows 10 chrome or something

Removing multiple channels

Feature request:
It would be nice to remove more than one channel per command while still making use of the auto completion.
This is helpful after importing your youtube subscriptions.

feedparser error

Recently started having a problem running ytcc on NixOS Unstable, here's the error:

nixos-workstation% ytcc
Updating channels...
Traceback (most recent call last):
  File "/nix/store/7cvik4jvdj7h1wm049ssh157616yirip-python3.8-feedparser-5.2.1/lib/python3.8/site-packages/feedparser.py", line 398, in __getattr__
    return self.__getitem__(key)
  File "/nix/store/7cvik4jvdj7h1wm049ssh157616yirip-python3.8-feedparser-5.2.1/lib/python3.8/site-packages/feedparser.py", line 356, in __getitem__
    return dict.__getitem__(self, key)
KeyError: 'published_parsed'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/z02820cl28g848y3w5j310dy42g5mhss-ytcc-1.8.4/bin/.ytcc-wrapped", line 5, in <module>
    main()
  File "/nix/store/z02820cl28g848y3w5j310dy42g5mhss-ytcc-1.8.4/lib/python3.8/site-packages/ytcc/cli.py", line 617, in main
    run()
  File "/nix/store/z02820cl28g848y3w5j310dy42g5mhss-ytcc-1.8.4/lib/python3.8/site-packages/ytcc/cli.py", line 596, in run
    update_all()
  File "/nix/store/z02820cl28g848y3w5j310dy42g5mhss-ytcc-1.8.4/lib/python3.8/site-packages/ytcc/cli.py", line 384, in update_all
    ytcc_core.update_all()
  File "/nix/store/z02820cl28g848y3w5j310dy42g5mhss-ytcc-1.8.4/lib/python3.8/site-packages/ytcc/core.py", line 161, in update_all
    self.database.add_videos(videos)
  File "/nix/store/z02820cl28g848y3w5j310dy42g5mhss-ytcc-1.8.4/lib/python3.8/site-packages/ytcc/database.py", line 121, in add_videos
    for video in videos:
  File "/nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/concurrent/futures/_base.py", line 611, in result_iterator
    yield fs.pop().result()
  File "/nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
    raise self._exception
  File "/nix/store/fjgnz0xfl04hsblsi4ym5y5akfh6mlmy-python3-3.8.5/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/nix/store/z02820cl28g848y3w5j310dy42g5mhss-ytcc-1.8.4/lib/python3.8/site-packages/ytcc/core.py", line 140, in _update_channel
    return [
  File "/nix/store/z02820cl28g848y3w5j310dy42g5mhss-ytcc-1.8.4/lib/python3.8/site-packages/ytcc/core.py", line 146, in <listcomp>
    publish_date=time.mktime(entry.published_parsed),
  File "/nix/store/7cvik4jvdj7h1wm049ssh157616yirip-python3.8-feedparser-5.2.1/lib/python3.8/site-packages/feedparser.py", line 400, in __getattr__
    raise AttributeError("object has no attribute '%s'" % key)
AttributeError: object has no attribute 'published_parsed'
nixos-workstation% ytcc -v
ytcc version 1.8.4

Copyright (C) 2015-2019  Wolfgang Popp
This program comes with ABSOLUTELY NO WARRANTY; This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU General
Public Licence for details.
nixos-workstation% uname -a
Linux nixos-workstation 5.7.16 #1-NixOS SMP Wed Aug 19 06:24:20 UTC 2020 x86_64 GNU/Linux

Fails when live video encountered

When running ytcc -ud and a current subscription is live streaming you get a repeating error and ytcc never exits. I think this is similar to #9.

In this example, I was trying to download the latest videos from the channel Jupiter Broadcasting while they were live streaming. The last line in the error would just repeat until the process was killed.

Edit: This might be an issue with youtube-dl?

Error output

[youtube] eU4NO_DWvs0: Downloading webpage
[youtube] eU4NO_DWvs0: Downloading video info webpage
[youtube] eU4NO_DWvs0: Downloading m3u8 information
[youtube] eU4NO_DWvs0: Downloading MPD manifest
[youtube] eU4NO_DWvs0: Downloading MPD manifest
[download] Destination: /data/videos/youtube/jblive.tv Year Review Holiday Stream 🍻.mp4
ffmpeg version n4.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.1 (GCC) 20180831
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
[hls,applehttp @ 0x561ee0358040] Opening 'https://r4---sn-aigl6ney.googlevideo.com/videoplayback/id/eU4NO_DWvs0.0/itag/95/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D136/hls_chunk_host/r4---sn-aigl6ney.googlevideo.com/playlist_type/DVR/gcr/gb/ei/gG4nXMzFB83dxwKn0oGABQ/initcwndbps/19690/mm/32/mn/sn-aigl6ney/ms/lv/mv/m/pl/32/keepalive/yes/mt/1546087976/disable_polymer/true/ip/2a01:4b00:ea1a:4c00:9ec3:fc64:f8ee:a574/ipbits/0/expire/1546109665/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,playlist_type,gcr,ei,initcwndbps,mm,mn,ms,mv,pl/signature/6D0B12AE81C73511DF5CA55820F11E02EFE5D92F.897208F439995672DE862359287BEC44004CB829/key/dg_yt0/playlist/index.m3u8/sq/115064/goap/clen%3D48404%3Blmt%3D1545857920282089/govp/clen%3D42372%3Blmt%3D1545857920282091/dur/2.000/file/seg.ts' for reading

YT Channel: https://www.youtube.com/user/jupiterbroadcasting
Live stream URL (at the time): https://www.youtube.com/watch?v=eU4NO_DWvs0

bug-report-info

ytcc --bug-report-info
---ytcc version---
1.7.3

---youtube-dl version---
2018.12.17

---feedparser version---
5.2.1

---lxml version---
4.2.5

---dateutil version---
2.7.5

---python version---
3.7.1 (default, Oct 22 2018, 10:41:28) 
[GCC 8.2.1 20180831]

---mpv version---
mpv 0.29.1 Copyright Β© 2000-2018 mpv/MPlayer/mplayer2 projects
 built on Sun Dec  9 16:21:27 CET 2018
ffmpeg library versions:
   libavutil       56.22.100
   libavcodec      58.35.100
   libavformat     58.20.100
   libswscale      5.3.100
   libavfilter     7.40.101
   libswresample   3.3.100
ffmpeg version: n4.1


---config dump---
[YTCC]
dbpath = ~/.local/share/ytcc/ytcc.db
downloaddir = /data/videos/youtube
mpvflags = --really-quiet --ytdl --ytdl-format=bestvideo[height<=?1080]+bestaudio/best
ytdloutputtemplate = %(title)s.%(ext)s

[youtube-dl]
format = bestvideo[height<=?1080]+bestaudio/best
outputtemplate = %(title)s.%(ext)s
loglevel = normal
ratelimit = 0
retries = 0
subtitles = off
thumbnail = on

[quickselect]
enabled = yes
ask = yes
alphabet = sdfervghnuiojkl

[TableFormat]
id = on
date = off
channel = on
title = on
url = off
watched = off

Can’t add channels in v2

I just tried migrating to v2 but i was unable to add subscriptions.

First i tried migrating via "Channel export and import". It displayed a bunch of infos about channels being added but "ytcc subscriptions" or "ytcc tui" stayed empty.

I then reset everything by deleting the config and database and tried adding a channel normally (ytcc subscribe). But that didn’t work either.

This was done using the ytcc-git from aur with commit d4d7199

Mark as not watched

Is your feature request related to a problem? Please describe.
When playing a video by mistake, it is mark as watched, even when exiting mpv after a few seconds.

Describe the solution you'd like
Add a feature to mark video as not watched

Additional context
In TUI, recently watched video can still be listed, with a different markup, to be able to unwatch them.

It can be also a good thing to monitor elapsed time in player, and ask the user if the video should be marked as watched whenever there is not enough elapsed time (half? 80%?).

Use `mm:ss` format for duration column

Currently, the duration is shown in seconds. It should be in mm:ss format instead. As most videos are probably shorter than an hour and likely not longer than a couple of hours, I prefer mm:ss over hh:mm:ss.

Adjustable format of publish date

Ytcc version 2 shows the publish date of a video by default. The date format should be adjustable. The default should be YYYY-MM-DD.

Improve logging

The loglevel config option and the --verbose flag should actually do something useful. youtube-dl's logging should probably use a custom logger to provide better control of what is printed when looking for new videos.

[V2] Don’t ignore age restricted videos

Currently ytcc/V2 ignores videos "due to age limit".

As far as i know this was implemented because youtube changed the api and youtube-dl couldn’t download these videos anymore. But, it seems to work again! I checked some of the videos ytcc/V2 ignored and was able to download them with youtube-dl or play them with mpv.

So could you include these videos again?

In case youtube restricts these again, youtube-dl also has options to give your login credentials. An alternative option would be to launch age restricted videos in a browser instead of mpv.

Remember position in some videos (aka resume)

Is your feature request related to a problem? Please describe.
Long videos can't be watched in one time. Resuming them can be useful.

Describe the solution you'd like
When exiting player in the middle of a video, it could be nice to be able to save the timestamp, and use it when relaunching the video.

Additional context
We have to see if it can be solved along with #69

Unicode error?

Tried to watch my youtube subscriptions but recieved an error instead...

$ ytcc                                                                                                                                                                                                                                        
Updating channels...

Traceback (most recent call last):
  File "/usr/bin/ytcc", line 4, in <module>
    main()
  File "/usr/lib/python3.6/site-packages/ytcc/cli.py", line 537, in main
    parse_args()
  File "/usr/lib/python3.6/site-packages/ytcc/cli.py", line 521, in parse_args
    list_videos()
  File "/usr/lib/python3.6/site-packages/ytcc/cli.py", line 220, in list_videos
    print_videos(videos)
  File "/usr/lib/python3.6/site-packages/ytcc/cli.py", line 202, in print_videos
    table_print(row_filter(table_header), table)
  File "/usr/lib/python3.6/site-packages/ytcc/cli.py", line 184, in table_print
    print(table_format.format(*header))
UnicodeEncodeError: 'ascii' codec can't encode character '\u2502' in position 6: ordinal not in range(128)

I'm guessing this is because one of the video titles simply has an unusual unicode character.

Thanks for making ytcc, I use it every day.

Cannot subscribe to any channel

I have tried this with several different channels, but I cannot subscribe to any channels. I have also tried with and without www.

$ ytcc -a "Jordan go to sleep" https://youtube.com/channel/UCJcK_CBW0M6TwtpUl99psxg
'https://youtube.com/channel/UCJcK_CBW0M6TwtpUl99psxg' is not a valid YouTube URL

I think it's failing here or here.

Bug report info:

$ ytcc --bug-report-info
mpv 0.32.0 Copyright Β© 2000-2020 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       56.31.100
   libavcodec      58.54.100
   libavformat     58.29.100
   libswscale      5.5.100
   libavfilter     7.57.100
   libswresample   3.5.100
ffmpeg version: 4.2.3

---ytcc version---
1.8.3

---youtube-dl version---
2020.06.16.1

---SQLAlchemy version---
1.3.11

---feedparser version---
5.2.1

---lxml version---
4.5.1

---python version---
3.7.8 (default, Jul  6 2020, 10:47:30) 
[GCC 9.3.0]

---mpv version---

---config dump---
[YTCC]
dbpath = ~/.local/share/ytcc/ytcc.db
downloaddir = [redacted]
mpvflags = --ytdl --ytdl-format=bestvideo[height<=?1080]+bestaudio/best
alphabet = sdfervghnuiojkl
orderby = date:desc,channel
defaultaction = play_video
subtitles = en
thumbnail = on
skiplivestream = yes

[color]
promptdownloadaudio = 2
promptdownloadvideo = 4
promptplayaudio = 2
promptplayvideo = 4
promptmarkwatched = 1
tablealternatebackground = 24

[youtube-dl]
format = bestvideo[height<=?1080]+bestaudio/best
outputtemplate = %(title)s.%(ext)s
loglevel = normal
ratelimit = 0
retries = 0
subtitles = off
thumbnail = on
skiplivestream = yes
mergeoutputformat = mkv

[TableFormat]
id = on
date = on
channel = on
title = on
url = off
watched = on

Filter by channel in the TUI

Is your feature request related to a problem? Please describe.
In v1, there was the handy -f switch that allowed for filtering the channels in the TUI.

Describe the solution you'd like
It would be good if this, or something similar were to be reimplemented in v2. It would also be good to be able to filter by tag.

Describe alternatives you've considered
It's possible that it could instead be applied within the TUI, but this doesn't match the v1 feature. This would be a nice addition, but not a replacement in my opinion.

Additional context
My use case for this is that I have a couple of different aliases (for v1) that look like this: ytcc -f <lots of channels>.

Other "Youtube" Providers

I was wondering if you are considering supporting other video provider services, especially those who are not Orwellian like youtube. What I consider as innocent videos are getting pulled from Youtube even in the midst of being downloaded by ytcc. This has gone too far. If the excellent ytcc only supports youtube then
regretfully from now on I will not use it.

Bitchute would be an example of a popular alternative.

Best wishes

Restrict YtCC to playlist within channel?

It appears to me that ytcc operates only on a Youtube 'Channel' basis (I may be wrong).. My question, Is there a way to limit ytcc results to a single 'Playlist' within a Channel?

For example, say Youtube channel 'X' posts many videos into numerous different playlists. Is there a way to limit ytcc to downloading only videos from within a single playlist rather than from all videos on the 'Videos' page of the given channel?

I have been able to do the same from CLI with youtube-dl, but seems to not be possible currently with ytcc. I would prefer to use ytcc as it seems much more efficient on network calls. Apologies for the naive question. Thanks!

Ignore failing video updates after a certain threshold

Sometimes a video that is still part of a playlist has been taken down. When searching the playlists for new videos, errors will be shown for unavailable videos. Ytcc should ignore unavailable videos after a few failed attempts.

Feature: Skip videos over certain duration

Is your feature request related to a problem? Please describe.

While we can skip livestreaming while live (fantastic) some youtubers now convert livestreams to videos after broadcast, these can last hours and be quite a sizable download (3G+).

Describe the solution you'd like

It looks like ytcc knows the duration of the video before downloading. Having an option to skip/mark videos longer than X duration in minutes would solve this.

[ytcc] 
max_duration=120

Updating seems broken

Since yesterday (2020-11-09) updating doesn’t add new videos despite multiple of my subscriptions published new videos since.

Gracefully skip live videos (and placeholders)

Some youtube channels put up placeholders for future live videos. When such videos are encountered, ytcc fails to download them with:

ERROR: This video is unavailable.
An Error occured while downloading the video

After which ytcc hard exits. Resulting in preceding videos not being marked as downloaded and locking up the download queue until the offending video is manually marked as watched.

This obviously breaks cron :p

Videos in a playlist uploaded on the same day are not sorted by time

Describe the bug
If a playlist/subscription has multiple videos uploaded on the same day, they are not sorted by time when using the publish_date ordering.

To Reproduce
Subscribe to a channel that publishes multiple videos per day and update.
Set the order_by value in ytcc.conf to publish_date:asc.
Execute ytcc list -p <channel>

Expected behavior
Videos are listed in the strict order they were published.

Environment, configuration and version information

---ytcc version---
2.0.1

---youtube-dl version---
2020.12.09

---SQLite version---
SQLite system library version: 3.34.0
Python module version: 2.6.0

---python version---
3.9.0 (default, Dec  6 2020, 18:02:34)
[Clang 12.0.0 (clang-1200.0.32.27)]

---mpv version---
mpv 0.33.0 Copyright Β© 2000-2020 mpv/MPlayer/mplayer2 projects
 built on Sun Nov 22 19:54:23 GMT 2020
FFmpeg library versions:
   libavutil       56.51.100
   libavcodec      58.91.100
   libavformat     58.45.100
   libswscale      5.7.100
   libavfilter     7.85.100
   libswresample   3.7.100
FFmpeg version: 4.3.1


---config dump---
[ytcc]
download_dir = ~/Downloads
mpv_flags = --really-quiet --ytdl --ytdl-format=bestvideo[height<=?1080]+bestaudio/best
order_by = publish_date:asc
video_attrs = id, title, publish_date, duration, playlists
playlist_attrs = name, url, tags
db_path = ~/.local/share/ytcc/ytcc.db
date_format = %Y-%m-%d
max_update_fail = 5
max_update_backlog = 20
age_limit = 0

[tui]
alphabet = sdfervghnuiojkl
default_action = play_video

[theme]
prompt_download_audio = 2
prompt_download_video = 4
prompt_play_audio = 2
prompt_play_video = 4
prompt_mark_watched = 1
table_alternate_background = 19

[youtube_dl]
format = bestvideo[height<=?1080]+bestaudio/best
output_template = %(title)s.%(ext)s
ratelimit = 0
retries = 0
subtitles = off
thumbnail = true
skip_live_stream = true
merge_output_format = mkv

Additional context
Example output from a channel below. I used the YouTube Data API to retrieve two of the videos (Part 225 and 224). 224's publishedAt property was one hour before 225, but in the list below all the videos for each day are sorted in descending order by time even though the ordering in the config file is publish_date:asc.

 id   β”‚ title                                                             β”‚ publish_date β”‚ duration β”‚ playlists
──────┼───────────────────────────────────────────────────────────────────┼──────────────┼──────────┼───────────────────
 56   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 202 β”‚ 2020-11-24   β”‚   32:21  β”‚ Aavak After Hours
 57   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 201 β”‚ 2020-11-24   β”‚   34:11  β”‚ Aavak After Hours
 58   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 200 β”‚ 2020-11-24   β”‚   32:04  β”‚ Aavak After Hours
 59   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 199 β”‚ 2020-11-24   β”‚   31:35  β”‚ Aavak After Hours
 60   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 198 β”‚ 2020-11-24   β”‚   30:15  β”‚ Aavak After Hours
 49   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 209 β”‚ 2020-11-25   β”‚   29:11  β”‚ Aavak After Hours
 50   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 208 β”‚ 2020-11-25   β”‚   29:14  β”‚ Aavak After Hours
 51   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 207 β”‚ 2020-11-25   β”‚   31:01  β”‚ Aavak After Hours
 52   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 206 β”‚ 2020-11-25   β”‚   35:05  β”‚ Aavak After Hours
 53   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 205 β”‚ 2020-11-25   β”‚   28:30  β”‚ Aavak After Hours
 54   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 204 β”‚ 2020-11-25   β”‚   31:08  β”‚ Aavak After Hours
 55   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 203 β”‚ 2020-11-25   β”‚   30:21  β”‚ Aavak After Hours
 41   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 217 β”‚ 2020-12-03   β”‚   31:41  β”‚ Aavak After Hours
 42   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 216 β”‚ 2020-12-03   β”‚   36:35  β”‚ Aavak After Hours
 43   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 215 β”‚ 2020-12-03   β”‚   32:30  β”‚ Aavak After Hours
 44   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 214 β”‚ 2020-12-03   β”‚   32:47  β”‚ Aavak After Hours
 45   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 213 β”‚ 2020-12-03   β”‚   29:07  β”‚ Aavak After Hours
 46   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 212 β”‚ 2020-12-03   β”‚   31:52  β”‚ Aavak After Hours
 47   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 211 β”‚ 2020-12-03   β”‚   31:05  β”‚ Aavak After Hours
 48   β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 210 β”‚ 2020-12-03   β”‚   25:10  β”‚ Aavak After Hours
 2451 β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 225 β”‚ 2020-12-09   β”‚   40:52  β”‚ Aavak After Hours
 2452 β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 224 β”‚ 2020-12-09   β”‚   32:56  β”‚ Aavak After Hours
 2453 β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 223 β”‚ 2020-12-09   β”‚   32:24  β”‚ Aavak After Hours
 2454 β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 222 β”‚ 2020-12-09   β”‚   33:54  β”‚ Aavak After Hours
 2455 β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 221 β”‚ 2020-12-09   β”‚   30:13  β”‚ Aavak After Hours
 2456 β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 220 β”‚ 2020-12-09   β”‚   30:04  β”‚ Aavak After Hours
 2457 β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 219 β”‚ 2020-12-09   β”‚   31:27  β”‚ Aavak After Hours
 2458 β”‚ Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 218 β”‚ 2020-12-09   β”‚   32:34  β”‚ Aavak After Hours

Partial responses for each video from the API:

{
  "kind": "youtube#videoListResponse",
  "etag": "xTwOH37rQ4erFVC3YQJ2CpE6SWw",
  "items": [
    {
      "kind": "youtube#video",
      "etag": "PXp1Up0QqBrdbhND8bSr8y6P5wc",
      "id": "OGUUo5V0CuQ",
      "snippet": {
        "publishedAt": "2020-12-10T04:00:02Z",
        "channelId": "UCk7U8vOfzutkuZ-coGdpXrw",
        "title": "Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 224",
{
  "kind": "youtube#videoListResponse",
  "etag": "zD1fJud1ccfJIQQm_SUjtzzuD9I",
  "items": [
    {
      "kind": "youtube#video",
      "etag": "BEj4UbeWNkTdXVe3hnzt9N7Nsuw",
      "id": "WQj-OJ6Pwqs",
      "snippet": {
        "publishedAt": "2020-12-10T05:00:21Z",
        "channelId": "UCk7U8vOfzutkuZ-coGdpXrw",
        "title": "Oxygen Not Included: Oassise – Let’s Play Stream Archive Part 225",

youtube-dl config file is ignored

Version info:

ytcc --version
1.6.1
> youtube-dl --version
2018.07.29
> mpv --version
mpv 0.29.0 Copyright Β© 2000-2018 mpv/MPlayer/mplayer2 projects
 built on Sun Jul 22 21:06:23 CEST 2018
ffmpeg library versions:
   libavutil       56.14.100
   libavcodec      58.18.100
   libavformat     58.12.100
   libswscale      5.1.100
   libavfilter     7.16.100
   libswresample   3.1.100
ffmpeg version: n4.0.2

When downloading a video using ytcc:

> ytcc
Updating channels...
[snip]
Play video "Video Name" by "Channel"?
[y(es)/n(o)/a(udio)/m(ark)/q(uit)/h(elp)] (Default: y): dv
[youtube] $video: Downloading webpage
[youtube] $video: Downloading video info webpage
[download] Destination: /path/$video.webm 

The youtube-dl config is being ignored. Output using plain youtube-dl:

> youtube-dl $video
[debug] System config: []
[debug] User config: ['-f', 'mp4[height<=?1080]+bestaudio/best', '-v']
[debug] Custom config: []
[debug] Command-line args: ['$video']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.07.29
[debug] Python version 3.6.6 (CPython) - Linux-4.17.10-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg n4.0.2, ffprobe n4.0.2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] video: Downloading webpage
[youtube] video: Downloading video info webpage
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on '$really_long_url'
[download] Destination: /parth/$video.mp4

~/.config/youtube-dl/config:

-f 'bestvideo[height<=?1080]+bestaudio/best'
-v

~/.config/ytcc/ytcc.conf:

[YTCC]
dbpath = ~/.local/share/ytcc/ytcc.db
downloaddir = ~/Stuff/YouTube
mpvflags = --really-quiet --ytdl --ytdl-format=bestvideo[height<=?1080]+bestaudio/best

[TableFormat]
id = on
date = off
channel = on
title = on
url = off
watched = off

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.