- Added a section to bug report template to dump `traceback.md` - Added better default `YTDL_OPTS` - Added `uploaded in`, `duration` and `tags` sections in picker - Replaced `title` section with `fulltitle` and `channel_id` with `uploader` in picker - Added a way to view descriptions using less(1) - Fixed curses not properly handling resizing - Moved text from center to 0, 0 because it was annoying - Made curses display the latest key fed to mpv - Made history be cleared automatically - Removed unnesesary manual writting to files using `readline.write_history_file(histfile)` - Improved the way search queries are handled and verified - Handled `EOFError` for when you CTRL + D the input Signed-off-by: Ari Archer <ari@mail.ari-web.xyz>
166 lines
No EOL
12 KiB
HTML
166 lines
No EOL
12 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head><title>Python: module myt</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
</head><body bgcolor="#f0f0f8">
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
|
<tr bgcolor="#7799ee">
|
|
<td valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>myt</strong></big></big> (version 0.7)</font></td
|
|
><td align=right valign=bottom
|
|
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/ari/Ari/coding/projects_/myt/src/myt">/home/ari/Ari/coding/projects_/myt/src/myt</a></font></td></tr></table>
|
|
<p><tt>A CLI tool for searching and watching videos on youtube with no spyware and MPV and yt-dlp</tt></p>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#aa55cc">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
|
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="curses.html">curses</a><br>
|
|
<a href="logging.html">logging</a><br>
|
|
<a href="os.html">os</a><br>
|
|
</td><td width="25%" valign=top><a href="random.html">random</a><br>
|
|
<a href="readline.html">readline</a><br>
|
|
<a href="requests.html">requests</a><br>
|
|
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
|
|
<a href="urllib.html">urllib</a><br>
|
|
<a href="warnings.html">warnings</a><br>
|
|
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ee77aa">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
|
<td width="100%"><dl>
|
|
<dt><font face="helvetica, arial"><a href="builtins.html#Exception">builtins.Exception</a>(<a href="builtins.html#BaseException">builtins.BaseException</a>)
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="myt.html#RestartProgramError">RestartProgramError</a>
|
|
</font></dt></dl>
|
|
</dd>
|
|
</dl>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="RestartProgramError">class <strong>RestartProgramError</strong></a>(<a href="builtins.html#Exception">builtins.Exception</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt><a href="builtins.html#Exception">Exception</a> raised when requiring program to restart its main function<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
<dd><a href="myt.html#RestartProgramError">RestartProgramError</a></dd>
|
|
<dd><a href="builtins.html#Exception">builtins.Exception</a></dd>
|
|
<dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd>
|
|
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
|
</dl>
|
|
<hr>
|
|
Data descriptors defined here:<br>
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
</dl>
|
|
<hr>
|
|
Methods inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br>
|
|
<dl><dt><a name="RestartProgramError-__init__"><strong>__init__</strong></a>(self, /, *args, **kwargs)</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
|
|
|
|
<hr>
|
|
Static methods inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br>
|
|
<dl><dt><a name="RestartProgramError-__new__"><strong>__new__</strong></a>(*args, **kwargs)<font color="#909090"><font face="helvetica, arial"> from <a href="builtins.html#type">builtins.type</a></font></font></dt><dd><tt>Create and return a new object. See help(type) for accurate signature.</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
|
<dl><dt><a name="RestartProgramError-__delattr__"><strong>__delattr__</strong></a>(self, name, /)</dt><dd><tt>Implement delattr(self, name).</tt></dd></dl>
|
|
|
|
<dl><dt><a name="RestartProgramError-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><tt>Return getattr(self, name).</tt></dd></dl>
|
|
|
|
<dl><dt><a name="RestartProgramError-__reduce__"><strong>__reduce__</strong></a>(...)</dt><dd><tt>Helper for pickle.</tt></dd></dl>
|
|
|
|
<dl><dt><a name="RestartProgramError-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><tt>Return repr(self).</tt></dd></dl>
|
|
|
|
<dl><dt><a name="RestartProgramError-__setattr__"><strong>__setattr__</strong></a>(self, name, value, /)</dt><dd><tt>Implement setattr(self, name, value).</tt></dd></dl>
|
|
|
|
<dl><dt><a name="RestartProgramError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
|
|
|
|
<dl><dt><a name="RestartProgramError-__str__"><strong>__str__</strong></a>(self, /)</dt><dd><tt>Return str(self).</tt></dd></dl>
|
|
|
|
<dl><dt><a name="RestartProgramError-with_traceback"><strong>with_traceback</strong></a>(...)</dt><dd><tt><a href="builtins.html#Exception">Exception</a>.<a href="#RestartProgramError-with_traceback">with_traceback</a>(tb) --<br>
|
|
set self.<strong>__traceback__</strong> to tb and return self.</tt></dd></dl>
|
|
|
|
<hr>
|
|
Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
|
|
<dl><dt><strong>__cause__</strong></dt>
|
|
<dd><tt>exception cause</tt></dd>
|
|
</dl>
|
|
<dl><dt><strong>__context__</strong></dt>
|
|
<dd><tt>exception context</tt></dd>
|
|
</dl>
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
</dl>
|
|
<dl><dt><strong>__suppress_context__</strong></dt>
|
|
</dl>
|
|
<dl><dt><strong>__traceback__</strong></dt>
|
|
</dl>
|
|
<dl><dt><strong>args</strong></dt>
|
|
</dl>
|
|
</td></tr></table></td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#eeaa77">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
|
|
<td width="100%"><dl><dt><a name="-ask_user"><strong>ask_user</strong></a>(prompt: str, valid_options: tuple[str, ...] = ()) -> str</dt><dd><tt>Ask user for input and parse it as an answer</tt></dd></dl>
|
|
<dl><dt><a name="-debug"><strong>debug</strong></a>(msg: str) -> None</dt><dd><tt>Print debug message</tt></dd></dl>
|
|
<dl><dt><a name="-die"><strong>die</strong></a>(msg: str) -> int</dt><dd><tt>Print a message to stderr and return error code</tt></dd></dl>
|
|
<dl><dt><a name="-download_media"><strong>download_media</strong></a>(url: str, extracted_info: dict[str, typing.Any]) -> int</dt><dd><tt>Download media from youtube</tt></dd></dl>
|
|
<dl><dt><a name="-fn_register"><strong>fn_register</strong></a> = register(...)</dt><dd><tt>register(func, *args, **kwargs) -> func<br>
|
|
<br>
|
|
Register a function to be executed upon normal program termination<br>
|
|
<br>
|
|
func - function to be called at exit<br>
|
|
args - optional arguments to pass to func<br>
|
|
kwargs - optional keyword arguments to pass to func<br>
|
|
<br>
|
|
func is returned to facilitate usage as a decorator.</tt></dd></dl>
|
|
<dl><dt><a name="-main"><strong>main</strong></a>() -> int</dt><dd><tt>Entry/main function</tt></dd></dl>
|
|
<dl><dt><a name="-make_new_config"><strong>make_new_config</strong></a>() -> None</dt><dd><tt>Make new configuration file</tt></dd></dl>
|
|
<dl><dt><a name="-new_mpv_client"><strong>new_mpv_client</strong></a>() -> mpv.MPV</dt><dd><tt>Create a new mpv.MPV() instance</tt></dd></dl>
|
|
<dl><dt><a name="-parse_args"><strong>parse_args</strong></a>() -> None</dt><dd><tt>Parse argv[1] arguments</tt></dd></dl>
|
|
<dl><dt><a name="-pick_video"><strong>pick_video</strong></a>(video_json: dict[str, typing.Any], __picked_video_url: Optional[str] = None) -> str</dt><dd><tt>Pick a video</tt></dd></dl>
|
|
<dl><dt><a name="-play_url"><strong>play_url</strong></a>(url: str) -> int</dt><dd><tt>Play a URL in MPV</tt></dd></dl>
|
|
<dl><dt><a name="-print_version_and_exit"><strong>print_version_and_exit</strong></a>() -> None</dt><dd><tt>Print version and exit</tt></dd></dl>
|
|
<dl><dt><a name="-show_in_less"><strong>show_in_less</strong></a>(text: str, next_fn: Any) -> Any</dt><dd><tt>Show text in less(1)</tt></dd></dl>
|
|
<dl><dt><a name="-view_thumbnail"><strong>view_thumbnail</strong></a>(video_json: dict[str, typing.Any], video_url: str, next_fn: Any) -> Any</dt><dd><tt>View thumbnail in default image viewer</tt></dd></dl>
|
|
</td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#55aa55">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
|
|
<td width="100%"><strong>ARGS</strong> = {'--version': <function print_version_and_exit>}<br>
|
|
<strong>Any</strong> = typing.Any<br>
|
|
<strong>CONFIG_FILE</strong> = '/home/ari/.config/myt.conf'<br>
|
|
<strong>DEFAULT_CONFIG</strong> = ['[history]', 'history_file = ~/.cache/.myt_history', 'history_length = 1000', '', '[resources]', 'youtube_url = https://www.youtube.com/', 'search_url = https://vid.puffyan.us/search/', '', '[messages]', 'print_debug = yes', '', '[config]', 'readline_config = ~/.inputrc', '']<br>
|
|
<strong>Fore</strong> = <colorama.ansi.AnsiFore object><br>
|
|
<strong>MIN_PYTHON</strong> = (3, 8)<br>
|
|
<strong>Optional</strong> = typing.Optional<br>
|
|
<strong>PIPE</strong> = -1<br>
|
|
<strong>SHARED_CONFIG</strong> = {}<br>
|
|
<strong>Style</strong> = <colorama.ansi.AnsiStyle object><br>
|
|
<strong>YTDL_LOGGER</strong> = <Logger ytdl-ignore (WARNING)><br>
|
|
<strong>YTDL_OPTS</strong> = {'addmetadata': True, 'cachedir': '/tmp/myt', 'logger': <Logger ytdl-ignore (WARNING)>, 'noplaylist': True, 'postprocessors': [{'key': 'FFmpegMetadata'}]}<br>
|
|
<strong>__annotations__</strong> = {'ARGS': dict[str, typing.Any], 'CONFIG_FILE': <class 'str'>, 'DEFAULT_CONFIG': list[str], 'SHARED_CONFIG': dict[str, typing.Any], 'YTDL_LOGGER': <class 'logging.Logger'>, 'YTDL_OPTS': dict[str, typing.Any]}<br>
|
|
<strong>__homepage__</strong> = 'https://ari-web.xyz/gh/myt'<br>
|
|
<strong>__license__</strong> = 'ArAr2'<br>
|
|
<strong>__license_note__</strong> = 'https://files.ari-web.xyz/files/ArAr.ari-archer.LICENSE'</td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#7799ee">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
|
|
<td width="100%">Ari Archer <ari@mail.ari-web.xyz></td></tr></table>
|
|
</body></html> |