OK Google, set Telegram as my YouTube music player!

To play music on YouTube in background on a mobile device requires YouTube Premium. Let's just set Telegram as our YouTube music player!

The idea is simple and straightforward. Firstly, apply a telegram bot and secure its token. Secondly, write a bot program that accepts one YouTube URL at a time from telegram user. Next, invoke youtube-dl to get the download URL of the best quality audio. Finally, send the downloaded audio file to corresponding telegram user.

The project is on my GitHub: https://github.com/BlueCocoa/youtube-music-bot

Continue reading OK Google, set Telegram as my YouTube music player!

Record YouTube Live Stream

最近不知不覺踩進了 hololive 這個兔子洞,其實真的蠻羨慕她們的,可以做自己喜歡的事,雖然其中也有不少人抱怨過休息的時間太少⋯⋯也許自己更羨慕的一點是可以有幾乎隨時一起嬉笑的朋友吧w

那麼雖然大多數 live stream 都會自動存檔,但是其中一部分 streamer 會選擇對某些直播不存檔,於是錯過直播的話,就只能等 clip 之類的了_(:3」∠)_ 因此就有了這個類似於電視錄影機一樣的想法~

项目放在了 GitHub 上 https://github.com/YouVCR/YouVCR~ 设置好 config.yaml 就可以使用了w

Continue reading Record YouTube Live Stream

可能隨時咕咕咕掉的 NLP 項目(1)—— 抓取 YouTube Live Chat

最近一邊想著畢業論文要寫什麼,一邊想著先做點有趣的東西~因為最近偶爾會看一下 YouTube 上烤肉 man 們剪輯的 hololive 的精華,所以暫且想要做個 NLP 相關的項目!不過倒不是自動翻譯這樣的功能,但具體是什麼自己還沒有完全想好(心裡有幾個點子,但是先寫出來又做不出來的話就太丟人了www),AAAAAAA~

那就總之先做一個抓取 YouTube Live Chat 的程式好了~其實小糾結了一下用什麼語言最方便,畢竟是抓取內容,而不是用 YouTube 官方的 API,所以也許 Python 是一個還不錯的選擇。

在寫這個工具的時候(2020 年 12 月 19 日,後文中的「目前」均指此日期),YouTube 上 Live Chat 回放的 API 是 https://www.youtube.com/live_chat_replay. 不過正如上面提到的,這個工具是直接爬取 Live Chat 的內容的,所以當你看到這篇博文的時候,很有可能 YouTube 已經更改了 API 或者內部的資料結構。

Continue reading 可能隨時咕咕咕掉的 NLP 項目(1)—— 抓取 YouTube Live Chat