chinda_fall_desu’s diary

竹内豊の日記

ヒューマンコンピューターインターフェースをもっと知りたいなー

Arduino CLIでターミナルから書き込みを行う

下記の動画でArduinoCLIの使い方が分かったのでまとめる。

www.youtube.com



Latest releases: Release 0.11.0-rc1 · arduino/arduino-cli · GitHub


①~⑥の手順で書き込むを行える。


①接続されているボードを確認。

> arduino-cli board list
Port Type              Board Name  FQBN            Core
COM3 Serial Port (USB) Arduino Uno arduino:avr:uno arduino:avr


②インストールされているCoreを確認する。(最初は何もインストールされていない)

> arduino-cli core list 

>


③Coreをインストールする。(①からarduino:avrが必要なことが分かる)

> arduino-cli core install arduino:avr
Downloading packages...
(略)
Installing arduino:arduinoOTA@1.3.0...
arduino:arduinoOTA@1.3.0 installed
Installing arduino:avr@1.8.2...
arduino:avr@1.8.2 installed


④スケッチを作成。空のinoファイルを作成し、それを編集する。

> arduino-cli sketch new MySketch
Sketch created in: D:\(略)\MySketch   
>
> cat .\MySketch\MySketch.ino

void setup() {
}

void loop() { 
}
>


⑤編集したスケッチをコンパイルする。(ここではArduino Uno用にコンパイルするように指定)

> arduino-cli compile -b arduino:avr:uno
Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.


コンパイルして生成されたhexファイルを書き込む。(①でわかったポート番号を使う)

> arduino-cli upload -b arduino:avr:uno -p COM3

おしまい。


(間違い等あればコメントお願いします。)

Pythonを使ってYoutube動画の出演者を当てる(東海オンエアで検証)

Youtube Data APIを使えば、Youtube動画の様々な情報を得られる。タイトルや概要欄などが分かる。Youtube Data APIについては以下の記事にまとめた。
chindafalldesu.hatenablog.com


上記のほかにコメント欄のコメントを取得することも可能である。
動画をそのまま解析することは難しいので動画の簡易的な解析にコメント欄を用いることができる。
コメントを使って、東海オンエアの動画に誰が出演しているか当ててみよう。


①コメント欄のコメントの取得

import requests
import time
videoId='JRizOqEl8EM'
apikey='(Youtube Data API のキー)'
url='https://www.googleapis.com/youtube/v3/commentThreads?part=snippet,id&videoId='+videoId+'&textFormat=plainText&maxResults=50&key='+apikey
response = requests.get(url)
num=0
for i in range(50):
    print(str(num)+'. '+response.json()['items'][i]['snippet']['topLevelComment']['snippet']['textDisplay'])
    num+=1

(実行結果)

> python .\channel4.py
0. 5:06 しばゆーw
1. 8倍速何言ってるかわからん笑
2. 8倍速なんかの曲みたい
3. 犬夜叉の手懐かしい
4. ボクシングのレベル高すぎな
5. なんかどっかで見たんだけど思い出せない、、
6. 2:102:102:102:10
見つからなくて自分で書きました。
:
:
45. 7:21 トモダチコレクション
46. 7:43  から2倍速でみると面白い
47. 8倍速どう森みたい
48. てつやでぶった?
49. 久々に見たら、1人どうしようもない雑魚になってて草


②東海オンエアの動画に誰が出演しているか当ててみる。
www.youtube.com
この動画の出演者を当ててみよう。出演者の名前の登場回数から当てる。

import requests
import time
apikey='(Youtube Data APIのキー)'
videoId=input("videoId: ")
url='https://www.googleapis.com/youtube/v3/commentThreads?part=snippet,id&videoId='+videoId+'&textFormat=plainText&maxResults=50&key='+apikey
yume=0
shiba=0
toshi=0
tetsu=0
mushi=0
ryo=0
response = requests.get(url)
for i in range(50):
    comment=response.json()['items'][i]['snippet']['topLevelComment']['snippet']['textDisplay']
    if 'ゆめまる' in comment:
        yume+=1
    elif 'しばゆー' in comment:
        shiba+=1
    elif 'てつや' in comment:
        tetsu+=1
    elif '虫眼鏡' in comment or '虫' in comment:
        mushi+=1
    elif 'としみつ' in comment:
        toshi+=1
    elif 'りょう' in comment:
        ryo+=1


for j in range(3):
    next=response.json()["nextPageToken"]
    nexturl=url+'&pageToken='+next
    response = requests.get(nexturl)
    for i in range(50):
        comment=response.json()['items'][i]['snippet']['topLevelComment']['snippet']['textDisplay']
        if 'ゆめまる' in comment:
            yume+=1
        elif 'しばゆー' in comment:
            shiba+=1
        elif 'てつや' in comment:
            tetsu+=1
        elif '虫眼鏡' in comment or '虫' in comment:
            mushi+=1
        elif 'としみつ' in comment:
            toshi+=1
        elif 'りょう' in comment:
            ryo+=1

print("しばゆー: "+str(shiba))
print("ゆめまる: "+str(yume))
print("としみつ: "+str(toshi))
print("てつや: "+str(tetsu))
print("虫眼鏡: "+str(mushi))
print("りょう: "+str(ryo)+"\n")

print("出演者: ")
if shiba>3:
    print("しばゆー")
if yume>3:
    print("ゆめまる")
if toshi>3:
    print("としみつ")
if tetsu>3:
    print("てつや")
if mushi>3:
    print("虫眼鏡")
if ryo>3:
    print("りょう")

(実行結果)

> python .\channel5.py
videoId: SEKB8bQNwwU
しばゆー: 14
ゆめまる: 14
としみつ: 9
てつや: 13
虫眼鏡: 0
りょう: 1

出演者:
しばゆー
ゆめまる
としみつ
てつや

この動画ではうまくいったようである。ほかの動画でも試してみる。


例1)
www.youtube.com

> python .\channel5.py
videoId: t6VuxAtz5IU
しばゆー: 18
ゆめまる: 0
としみつ: 2
てつや: 19
虫眼鏡: 19
りょう: 9

出演者:
しばゆー
てつや
虫眼鏡
りょう


例2)
www.youtube.com

> python .\channel5.py
videoId: _WE8CwuDDEA
しばゆー: 14
ゆめまる: 0
としみつ: 12
てつや: 8
虫眼鏡: 0
りょう: 0

出演者:
しばゆー
としみつ
てつや


仕組みはかなりシンプルだが、うまく動画の解析を行えているようである。
有名人辞書、名前辞書などを作れば、Youtubeのすべての動画の出演者を当てることも可能かもしれない。


(最後まで読んでいただきありがとうございます。間違い等あればコメントよろしくお願いいたします。)

東海オンエアの "臭い"動画をpythonを使って探してみた

東海オンエアの"臭い"動画をYoutube Data API と辞書を使って探してみた。流れは以下の通りである。
Youtube Data APIを使って、東海オンエアのチャンネルの動画タイトルを取得する
 ↓
②動画タイトルを単語ごとに分割する
 ↓
③辞書を使って動画タイトルを分析する




詳細はそれぞれ以下の記事にまとめてある。
Youtube Data APIを使って、東海オンエアのチャンネルの動画タイトルを取得する
chindafalldesu.hatenablog.com


②動画タイトルを単語ごとに分割する
chindafalldesu.hatenablog.com


③辞書を使って動画タイトルを分析する
chindafalldesu.hatenablog.com


'臭い'動画を探すために以下の辞書を使う。

word2score={'臭い':5,'臭':5,'閲覧':1,'汚い':3,'不潔':3,'不衛生':3,'劣悪':1,'便所':1, 'ごみ':1, 'うんこ':3,'精子':1,'珍':1,'棒':1,'酒':1,'酔':1,'酔う':1, '酔い':1, '泥酔':1 }

ソースコード

import MeCab
import pickle
import pandas
import requests
import time

channelid='UCutJqz56653xV2wwSvut_hQ'
apikey='(Youtube Data APIのキー)'
url = 'https://www.googleapis.com/youtube/v3/search?key='+apikey+'&channelId='+channelid+'&part=snippet,id&order=date&maxResults=50'
num=1
sentences=[]
vid=[]

response = requests.get(url)

for i in range(50):
    sentences.append(response.json()['items'][i]['snippet']['title'])
    vid.append("[https://www.youtube.com/watch?v="+response.json()['items'][i]['id']['videoId']+':embed:cite]')
    num+=1

for j in range(4):
    time.sleep(1)
    next=response.json()["nextPageToken"]
    nexturl=url+'&pageToken='+next
    response = requests.get(nexturl)
    for i in range(50):
        sentences.append(response.json()['items'][i]['snippet']['title'])
        try:
            vid.append("[https://www.youtube.com/watch?v="+response.json()['items'][i]['id']['videoId']+':embed:cite]')
        except:
            vid.append("NULL")
        num+=1

t=MeCab.Tagger('-Ochasen')
words_list=[]

for sentence in sentences:
    words=[]
    parsed=t.parse(sentence)
    for line in parsed.splitlines()[:-1]:
        words.append(line.split('\t')[2])
    words_list.append(words)

word2score={'臭い':5,'臭':5,'閲覧':1,'汚い':3,'不潔':3,'不衛生':3,'劣悪':1,'便所':1, 'ごみ':1, 'うんこ':3,'精子':1,'珍':1,'棒':1,'酒':1,'酔':1,'酔う':1, '酔い':1, '泥酔':1 }

scores=[]
for words in words_list:
    score=0
    for word in words:
        if word in word2score:
            score+=word2score[word]
    scores.append(score)

data=dict(zip(sentences,scores))
data_sorted = sorted(data.items(),key=lambda x:x[1], reverse=True)
for i in range(5):
    print(data_sorted[i])

# data=dict(zip(vid,scores))
# data_sorted = sorted(data.items(),key=lambda x:x[1], reverse=True)
# for i in range(5):
#     print(data_sorted[i][0])

(実行結果①)

> python .\words10.py
('【いい匂いはNG】「臭くておいしい料理」選手権!', 5)
('【酔酔酔】当てるまで終われない利き日本酒', 4)
('「ネコのうんこコーヒー」てつやネコのでも美味しいんじゃね!?', 3)
('精子観察キットで東海オンエアの精子を測定したらまさかの...', 2)
('【閲覧注意】この動画を見ると頭がおかしくなります。', 1)

(実行結果②)はてなブログでそのまま動画を閲覧できるように編集

> python .\words10.py

www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com

このやり方を使えば主観的な概念で動画を検索することができる。
例えば、綺麗、汚い、行きたい、素敵など主観的な概念を辞書を使って単語に落とし込み、それを使って検索を行うことができる。


(間違い等あればコメントよろしくお願いいたします。)

pythonと辞書で文章を分類する

まずは既存の辞書を使って、文章の分類を行い、その後自前の辞書を使って分類を行う。
辞書を使う前に文章を単語ごとに分割する必要がある。そのやり方は以下の記事にまとめた。


①極性判定を行う
Open Resources/Japanese Sentiment Polarity Dictionary - 東北大学 乾・鈴木研究室 / Communication Science Lab, Tohoku University
日本語評価極性辞書を用いて、極性判定を行う。
ソースコード

import MeCab
import pickle
import pandas

file=open("title.pickle", "rb")
sentences=pickle.load(file)
file.close()

t=MeCab.Tagger('-Ochasen')
words_list=[]

for sentence in sentences:
    words=[]
    parsed=t.parse(sentence)
    for line in parsed.splitlines()[:-1]:
        words.append(line.split('\t')[2])
    # print(words)
    words_list.append(words)
# print(words_list)

wago=pandas.read_csv('wago.121808.pn', header=None, sep='\t')
word2score={}
values={'ポジ(経験)':1,'ポジ(評価)':1, 'ネガ(経験)':-1, 'ネガ(評価)':-1}

for word, label in zip(wago.loc[:, 1], wago.loc[:, 0]):
    word2score[word]=values[label]

scores=[]
for words in words_list:
    score=0
    for word in words:
        if word in word2score:
            score+=word2score[word]
    scores.append(score)

scores_df=pandas.DataFrame({'sentence': sentences, 'score': scores}, columns=['sentence', 'score'])

scores_df_sorted=scores_df.sort_values('score', ascending=False)
print(scores_df_sorted.head(5))

scores_df_sorted=scores_df.sort_values('score', ascending=True)
print(scores_df_sorted.head(5))

(実行結果)

> python .\words4.py
                                  sentence  score
36   【1位は商品化】売れなくてもいい…!珍しい東海オンエアグッズプレゼン大会!      2
188                  【衝撃】現実に存在する信じられない超人5選      1
164           ◯◯屋さんで◯◯せずにどれだけ楽しむことができるのか!?      1
214          【超楽しい】お安く済ませて!チーム対抗揃えてAtoZ!!!      1
72    【事件発生】「なんで落ちてるの?」っていう珍しいものを拾ってこい選手権!      1
                           sentence  score
218    【りうょり】逆にむずい!高級食材を全力で不味くせよ!!!     -1
85   【10月】海!BBQ!キャンプ!時間内に失った夏を取り戻せ!     -1
205     材料そろえたのに何作るか忘れちゃった!代わりに作って!     -1
45      【検証】一週間ガチで呪い続けたらメンバーは死ぬのか?     -1
141     【泥棒】しばゆーがすぐ物を盗むので現行犯で逮捕します。     -1


②自前の辞書を使って分類
お酒に関する動画を見つけるために下記のリストを作り、分類を行う。

word2score={'酒':1,'飲':1,'酔':1,'飲む':1,'酔う':1, '酔い':1, '泥酔':1 }

ソースコード

import MeCab
import pickle
import pandas

file=open("title.pickle", "rb")
sentences=pickle.load(file)
file.close()

t=MeCab.Tagger('-Ochasen')
words_list=[]

for sentence in sentences:
    words=[]
    parsed=t.parse(sentence)
    for line in parsed.splitlines()[:-1]:
        words.append(line.split('\t')[2])
    words_list.append(words)

wago=pandas.read_csv('wago.121808.pn', header=None, sep='\t')

word2score={'酒':1,'飲':1,'酔':1,'飲む':1,'酔う':1, '酔い':1, '泥酔':1 }

scores=[]
for words in words_list:
    score=0
    for word in words:
        if word in word2score:
            score+=word2score[word]
    scores.append(score)

scores_df=pandas.DataFrame({'sentence': sentences, 'score': scores}, columns=['sentence', 'score'])

scores_df_sorted=scores_df.sort_values('score', ascending=False)
print(scores_df_sorted.head(5))

(実行結果)

> python .\words5.py
                                      sentence  score
93                        【酔酔酔】当てるまで終われない利き日本酒      4
246  【ゆる動画】たまには6人でお酒でも飲んで話そうよ!でも平均台から落ちたら負け!!!      2
68        ドラマ撮影中、ワンカット毎にお酒一杯飲んだらどうなっちゃうの!?【後編】      2
69        ドラマ撮影中、ワンカット毎にお酒一杯飲んだらどうなっちゃうの!?【前編】      2
114                    【半分飲み会】大人が全力でおねしょに挑戦します      1

参考
寺田学 『Pythonによるあたらしいデータ分析の教科書 (AI&TECHNOLOGY)』 翔泳社 (2018/9/19)


(間違い等あればコメントよろしくお願いいたします。)

pythonとMeCabで文章を単語ごとに分割

MeCab: Yet Another Part-of-Speech and Morphological Analyzer
Mecabを使えば形態素解析を行えるので、それを使って文章を単語ごとに分割する


①文章を単語ごとに分割する
ソースコード

import MeCab
document="【りょうやん】みんなの「お前おかしいよ!」っていう5対1を見つけ合おう!!!"
words=[]

t=MeCab.Tagger('-Ochasen')
parsed=t.parse(document)
for line in parsed.splitlines()[:-1]:
    words.append(line.split('\t')[0])
print(words)

(実行結果)

> python .\words.py
['【', 'りょう', 'やん', '】', 'みんな', 'の', '「', 'お前', 'おかしい', 'よ', '!', '」', 'っていう', '5', '対', '1', 'を', '見つけ', '合お', 'う', '!', '!', '!']


②複数文を単語ごとに分割する
ソースコード

import MeCab
sentences=['【りょうやん】みんなの「お前おかしいよ!」っていう5対1を見つけ合おう!!!', '【46道府県旅行の旅!滋賀県編】〜黄昏の湖、道化師の鎮魂歌〜', '【穴を制せ】負けたらピアスの対決!!穴王!!!']
t=MeCab.Tagger('-Ochasen')
words_list=[]

for sentence in sentences:
    words=[]
    parsed=t.parse(sentence)
    for line in parsed.splitlines()[:-1]:
        words.append(line.split('\t')[0])
    words_list.append(words)
print(words_list)

(実行結果)

> python .\words2.py
[['【', 'りょう', 'やん', '】', 'みんな', 'の', '「', 'お前', 'おかしい', 'よ', '!', '」', 'っていう', '5', '対', '1', 'を', '見つけ', '合お', 'う', '!', '!', '!'], ['【', '4', '6', '道府県', '旅行', 'の', '旅', '!', '滋賀', '県', '編', '】', '〜', '黄昏', 'の', '湖', '、', '道化師', 'の', '鎮魂歌', '〜'], ['【', '穴', 'を', '制せ', '】', '負け', ' たら', 'ピアス', 'の', '対決', '!', '!', '穴', '王', '!', '!', '!']]


③ファイルから文章を取り出し、分割する
ソースコード

import MeCab
import pickle

file=open("sample.pickle", "rb")
sentences=pickle.load(file)
file.close()
print(sentences)

t=MeCab.Tagger('-Ochasen')
words_list=[]

for sentence in sentences:
    words=[]
    parsed=t.parse(sentence)
    for line in parsed.splitlines()[:-1]:
        words.append(line.split('\t')[0])
    words_list.append(words)
print(words_list)

(実行結果)

> python .\words3.py
['【りょうやん】みんなの「お前おかしいよ!」っていう5対1を見つけ合おう!!!', '【46道府県旅行の旅!滋賀県編】〜黄昏の湖、道化師の鎮魂歌〜', '【穴を制せ】負けたらピアスの対決!!穴王!!!']
[['【', 'りょう', 'やん', '】', 'みんな', 'の', '「', 'お前', 'おかしい', 'よ', '!', '」', 'っていう', '5', '対', '1', 'を', '見つけ', '合お', 'う', '!', '!', '!'], ['【', '4', '6', '道府県', '旅行', 'の', '旅', '!', '滋賀', '県', '編', '】', '〜', '黄昏', 'の', '湖', '、', '道化師', 'の', '鎮魂歌', '〜'], ['【', '穴', 'を', '制せ', '】', '負け', ' たら', 'ピアス', 'の', '対決', '!', '!', '穴', '王', '!', '!', '!']]


④活用形を終止形にする
(変更点)

   words.append(line.split('\t')[2])

(実行結果)

> python .\words3.py
['【りょうやん】みんなの「お前おかしいよ!」っていう5対1を見つけ合おう!!!', '【46道府県旅行の旅!滋賀県編】〜黄昏の湖、道化師の鎮魂歌〜', '【穴を制せ】負けたらピアスの対決!!穴王!!!']
[['【', 'りょう', 'やん', '】', 'みんな', 'の', '「', 'お前', 'おかしい', 'よ', '!', '」', 'っていう', '5', '対', '1', 'を', '見つける', '合う', 'う', '!', '!', '!'], ['【', ' 4', '6', '道府県', '旅行', 'の', '旅', '!', '滋賀', '県', '編', '】', '〜', '黄昏', 'の', '湖', '、', '道化師', 'の', '鎮魂歌', '〜'], ['【', '穴', 'を', '制す', '】', '負ける', 'た', 'ピアス', 'の', '対決', '!', '!', '穴', '王', '!', '!', '!']]


参考
寺田学 『Pythonによるあたらしいデータ分析の教科書 (AI&TECHNOLOGY)』 翔泳社 (2018/9/19)



(間違い等あればコメントよろしくお願いいたします。)

Youtubeの世界各国のトレンドをPythonで取得

Youtube Data APIを使って、世界各国のトレンドを見てみる。
Youtube Data APIの使い方は以下の記事にまとめてある。
chindafalldesu.hatenablog.com


・方針
https://www.googleapis.com/youtube/v3/videos? に続けて、欲しい動画に合わせてパラメータを指定する。chartパラメータにmostPopularを指定し、regionCodeパラメータに国名コードを指定すれば、好きな国のトレンドを取得できる。
ISO 3166-1 - Wikipedia


ソースコード

import requests
import time
country='(国名コード JPとか)'
apikey='(Youtube Data api のキー)'
url='https://www.googleapis.com/youtube/v3/videos?part=snippet,id&chart=mostPopular&regionCode='+country+'&maxResults=3&key='+apikey

response = requests.get(url)

for i in range(3):
    print("[https://www.youtube.com/watch?v="+response.json()['items'][i]['id']+':embed:cite]')
    # print(response.json()['items'][i]['snippet']['title'])



世界各国のトレンドTOP3を取得していこう!
はてなブログにそのままリンクが張れるようにソースコードを編集している。実際に使う場合はその部分を適宜変更してほしい。



(2020/02/09時点のトレンド)
①日本
> python .\trend.py
www.youtube.com
www.youtube.com
www.youtube.com


②インド
> python .\trend.py
www.youtube.com
www.youtube.com
www.youtube.com

③マレーシア
> python .\trend.py
www.youtube.com
www.youtube.com
www.youtube.com


④フランス
> python .\trend.py
www.youtube.com
www.youtube.com
www.youtube.com


⑤ブラジル
> python .\trend.py
www.youtube.com
www.youtube.com
www.youtube.com


⑥スペイン
> python .\trend.py
www.youtube.com
www.youtube.com
www.youtube.com


それぞれの国の特色が表れていて面白い。


(間違い等あればコメントよろしくお願いいたします。)

Pythonを使って虫眼鏡さん編集の動画を探し出してみた

東海オンエアの動画から虫眼鏡さん編集の動画だけを集めたかったので、PythonYoutube Data APIを使ってその動画を探し出してみた。
Youtube Data APIの使い方は下記の記事にまとめてある。
chindafalldesu.hatenablog.com


直近150作品から探した。
チャンネルidから全動画のidを取得し、そのidから動画の概要欄を取得。その概要欄から '編集:虫眼鏡' を探す。

ソースコード

import requests
import time
channelid='UCutJqz56653xV2wwSvut_hQ'
apikey='(Youtube Data api のキー)'
url = 'https://www.googleapis.com/youtube/v3/search?key='+apikey+'&channelId='+channelid+'&part=snippet,id&order=date&maxResults=50'
num=1

response = requests.get(url)

for i in range(50):
    id=response.json()['items'][i]['id']['videoId']
    vurl = 'https://www.googleapis.com/youtube/v3/videos?id='+id+'&key='+apikey+'&part=snippet,contentDetails,statistics,status'
    vresponse = requests.get(vurl)
    if '編集:虫眼鏡' in vresponse.json()['items'][0]['snippet']['description']:
        print(response.json()['items'][i]['snippet']['title']+'    https://www.youtube.com/watch?v='+id)
        # print("[https://www.youtube.com/watch?v="+id+':embed:cite]')
    num+=1

for j in range(2):
    next=response.json()["nextPageToken"]
    nexturl=url+'&pageToken='+next
    response = requests.get(nexturl)

    for i in range(50):
        id=response.json()['items'][i]['id']['videoId']
        vurl = 'https://www.googleapis.com/youtube/v3/videos?id='+id+'&key='+apikey+'&part=snippet,contentDetails,statistics,status'
        vresponse = requests.get(vurl)
        if '編集:虫眼鏡' in vresponse.json()['items'][0]['snippet']['description']:
            print(response.json()['items'][i]['snippet']['title']+'    https://www.youtube.com/watch?v='+id)
            # print("[https://www.youtube.com/watch?v="+id+':embed:cite]')
            num+=1


(実行結果①)

> python .\makeinu.py
【改名はまさかの…】結局誰が一番球技上手いの? 第1回球技王!【後編】    https://www.youtube.com/watch?v=z9WHIkedhz8
【最下位は改名】結局誰が一番球技上手いの? 第1回球技王!【前編】    https://www.youtube.com/watch?v=CL1iCcXJegw
【大ブランク】3回転んだら即終了スノボ!    https://www.youtube.com/watch?v=w70hKDuZbJk
【運×演技力】相談なしで5人の衣装を揃えて即興コントを演じきれ!    https://www.youtube.com/watch?v=5o6MObM4vTE
【成金集団】東海オンエアの金銭感覚は麻痺していないのか!?    https://www.youtube.com/watch?v=6ggVYzGxNX0
動画撮影中にハプニング発生!?一番スマートな対応ができるのは誰だ!    https://www.youtube.com/watch?v=hkN2-S3z-RQ
【視聴者アンケート】今までの動画の中で「一番の名言」って何?    https://www.youtube.com/watch?v=TytXc_MPhE0
【46道府県旅行の旅!佐賀県編】〜なんだ、楽園はここにあったのか〜    https://www.youtube.com/watch?v=Ij7tLajES1w
 :
 :
【真剣将棋】6人がかりならプロ棋士といい勝負できるのでは?    https://www.youtube.com/watch?v=MoooUslrQDs
【新娯楽】開けられるのは「質問の答えの数字」だけ!東海オンエアビンゴ大会!    https://www.youtube.com/watch?v=zZFja1crjcM
【ご報告】東海オンエア、引っ越します    https://www.youtube.com/watch?v=RAR5ku_he04
【脱六本木】「◯本木」っていう地名、全部コンプリートしたい!!    https://www.youtube.com/watch?v=iABRvpxcmOQ


(実行結果②)はてなブログでそのまま閲覧できるように編集
> python .\makeinu.py
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com
www.youtube.com