回答編集履歴
1
修正
answer
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
import subprocess
|
|
3
3
|
|
|
4
4
|
url = 'https://www.youtube.com/watch?v=KP-2oBXwNuI'
|
|
5
|
-
cmd = 'youtube-dl -e -s ' + url
|
|
6
|
-
res = subprocess.check_output(
|
|
5
|
+
res = subprocess.check_output(f'youtube-dl -e --get-id {url}'.split())
|
|
7
|
-
|
|
6
|
+
res = res.decode('shift_jis').rstrip('\n').replace('\n', '-') # .decode('utf-8')?
|
|
7
|
+
print(res + '.mp3')
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
```
|