Merge pull request #258 from bthrx/yt-stdin

modified yt to also accept urls via stdin
This commit is contained in:
xssdoctor 2024-03-16 12:33:50 -04:00 committed by GitHub
commit 371f16fac9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,7 @@ import os
import json
import isodate
import argparse
import sys
def get_video_id(url):
@ -82,4 +83,8 @@ def main():
parser.add_argument('--transcript', action='store_true',
help='Output only the transcript')
args = parser.parse_args()
if args.url is None:
args.url = sys.stdin.readline().strip()
main_function(args.url, args)