Skip to content

Commit

Permalink
Merge pull request #258 from bthrx/yt-stdin
Browse files Browse the repository at this point in the history
modified yt to also accept urls via stdin
  • Loading branch information
xssdoctor authored Mar 16, 2024
2 parents 059a737 + 164fe20 commit 371f16f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions installer/client/cli/yt.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import json
import isodate
import argparse
import sys


def get_video_id(url):
Expand Down Expand Up @@ -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)

0 comments on commit 371f16f

Please sign in to comment.