0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【自動】Youtube Live の.m3u8ファイルURLを取得して QuickTime Player で再生するスクリプト

Last updated at Posted at 2021-04-08

Youtube のライセンスなしの動画の HLS URL を取得する方法の記事を見かけたので、
この方法を自動化して、QuickTime Player で再生するスクリプトを作りました。

# !/usr/bin/env zsh

VIDEO_ID="7NOSDKb0HlU"

HLS_URL="$(curl "https://www.youtube.com/get_video_info?video_id=$VIDEO_ID" | python3 -c "from urllib.parse import parse_qs; import json; print(json.dumps(json.loads(parse_qs(input())['player_response'][0])))" | jq -r .streamingData.hlsManifestUrl)"

open -a 'QuickTime Player' "$HLS_URL"

参考

【手動】Youtubeの動画の.m3u8ファイルURLを取得する

記事を公開してくださった方、ありがとうございました!

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?