Compare commits
878 Commits
2016.04.06
...
2016.07.03
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0cfd82dda | ||
|
|
1b734adb2d | ||
|
|
9b724d7277 | ||
|
|
c3a5dd3b5d | ||
|
|
e3755a624b | ||
|
|
95cf60e826 | ||
|
|
6b03e1e25d | ||
|
|
712b0b5b70 | ||
|
|
6a424391d9 | ||
|
|
dbf0157a26 | ||
|
|
7deef1ba67 | ||
|
|
fd6ca38262 | ||
|
|
bdafd88da0 | ||
|
|
7a1e71575e | ||
|
|
ac2d8f54d1 | ||
|
|
14ff6baa0e | ||
|
|
bb08101ec4 | ||
|
|
bc4b2d75ba | ||
|
|
35fc3021ba | ||
|
|
347227237b | ||
|
|
564dc3c6e8 | ||
|
|
9f4576a7eb | ||
|
|
f11315e8d4 | ||
|
|
0c2ac64bb8 | ||
|
|
a9eede3913 | ||
|
|
9e29ef13a3 | ||
|
|
eaaaaec042 | ||
|
|
3cb3b60064 | ||
|
|
044e3d91b5 | ||
|
|
c9e538a3b1 | ||
|
|
76dad392f5 | ||
|
|
9617b557aa | ||
|
|
bf4fa24414 | ||
|
|
20361b4f25 | ||
|
|
05a0068a76 | ||
|
|
66a42309fa | ||
|
|
fd94e2671a | ||
|
|
8ff6697861 | ||
|
|
eafa643715 | ||
|
|
049da7cb6c | ||
|
|
7dbeee7e22 | ||
|
|
93ad6c6bfa | ||
|
|
329179073b | ||
|
|
4d86d2008e | ||
|
|
ab47b6e881 | ||
|
|
df43389ade | ||
|
|
397b305cfe | ||
|
|
e496fa50cd | ||
|
|
06a96da15b | ||
|
|
70157c2c43 | ||
|
|
c58ed8563d | ||
|
|
4c7821227c | ||
|
|
42362fdb5e | ||
|
|
97124e572d | ||
|
|
32616c14cc | ||
|
|
8174d0fe95 | ||
|
|
8704778d95 | ||
|
|
c287f2bc60 | ||
|
|
9ea5c04c0d | ||
|
|
fd7a7498a4 | ||
|
|
e3a6747d8f | ||
|
|
f41ffc00d1 | ||
|
|
81fda15369 | ||
|
|
427cd050a3 | ||
|
|
b0c200f1ec | ||
|
|
92747e664a | ||
|
|
f1f336322d | ||
|
|
bf8dd79045 | ||
|
|
c6781156aa | ||
|
|
f484c5fa25 | ||
|
|
88d9f6c0c4 | ||
|
|
3c9c088f9c | ||
|
|
fc3996bfe1 | ||
|
|
5b6ad8630c | ||
|
|
30105f4ac0 | ||
|
|
1143535d76 | ||
|
|
7d52c052ef | ||
|
|
a2406fce3c | ||
|
|
3b34ab538c | ||
|
|
ac782306f1 | ||
|
|
0c00e889f3 | ||
|
|
ce96ed05f4 | ||
|
|
0463b77a1f | ||
|
|
2d185706ea | ||
|
|
b72b44318c | ||
|
|
46f59e89ea | ||
|
|
b4241e308e | ||
|
|
3d4b08dfc7 | ||
|
|
be49068d65 | ||
|
|
525cedb971 | ||
|
|
de3c7fe0d4 | ||
|
|
896cc72750 | ||
|
|
c1ff6e1ad0 | ||
|
|
fee70322d7 | ||
|
|
8065d6c55f | ||
|
|
494172d2e5 | ||
|
|
6e3c2047f8 | ||
|
|
011bd3221b | ||
|
|
b46eabecd3 | ||
|
|
0437307a41 | ||
|
|
22b7ac13ef | ||
|
|
96f88e91b7 | ||
|
|
3331a4644d | ||
|
|
adf1921dc1 | ||
|
|
97674f0419 | ||
|
|
73843ae8ac | ||
|
|
f2bb8c036a | ||
|
|
75ca6bcee2 | ||
|
|
089657ed1f | ||
|
|
b5eab86c24 | ||
|
|
c8e3e0974b | ||
|
|
dfc8f46e1c | ||
|
|
c143ddce5d | ||
|
|
169d836feb | ||
|
|
6ae938b295 | ||
|
|
cf40fdf5c1 | ||
|
|
23bdae0955 | ||
|
|
ca74c90bf5 | ||
|
|
7cfc1e2a10 | ||
|
|
1ac5705f62 | ||
|
|
e4f90ea0a7 | ||
|
|
cdfc187cd5 | ||
|
|
feef925f49 | ||
|
|
19e2d1cdea | ||
|
|
8369a4fe76 | ||
|
|
1f749b6658 | ||
|
|
819707920a | ||
|
|
43518503a6 | ||
|
|
5839d556e4 | ||
|
|
6c83e583b3 | ||
|
|
6aeb64b673 | ||
|
|
6cd64b6806 | ||
|
|
e154c65128 | ||
|
|
a50fd6e026 | ||
|
|
6a55bb66ee | ||
|
|
7c05097633 | ||
|
|
589568789f | ||
|
|
7577d849a6 | ||
|
|
cb23192bc4 | ||
|
|
41c1023300 | ||
|
|
90b6288cce | ||
|
|
c1823c8ad9 | ||
|
|
d7c6c656c5 | ||
|
|
b0b128049a | ||
|
|
e8f13f2637 | ||
|
|
b5aad37f6b | ||
|
|
6d0d4fc26d | ||
|
|
0278aa443f | ||
|
|
1f35745758 | ||
|
|
573c35272f | ||
|
|
09e3f91e40 | ||
|
|
1b6cf16be7 | ||
|
|
26264cb056 | ||
|
|
a72df5f36f | ||
|
|
c878e635de | ||
|
|
0f47cc2e92 | ||
|
|
5fc2757682 | ||
|
|
e3944c2621 | ||
|
|
667d96480b | ||
|
|
e6fe993c31 | ||
|
|
d0d93f76ea | ||
|
|
20a6a154fe | ||
|
|
f011876076 | ||
|
|
6929569403 | ||
|
|
eb451890da | ||
|
|
ded7511a70 | ||
|
|
d2161cade5 | ||
|
|
27e5fa8198 | ||
|
|
efbd1eb51a | ||
|
|
369ff75081 | ||
|
|
47212f7bcb | ||
|
|
4c93ee8d14 | ||
|
|
8bc4dbb1af | ||
|
|
6c3760292c | ||
|
|
4cef70db6c | ||
|
|
ff4af6ec59 | ||
|
|
d01fb21d4c | ||
|
|
a4ea28eee6 | ||
|
|
bc2a871f3e | ||
|
|
1759672eed | ||
|
|
fea55ef4a9 | ||
|
|
16b6bd01d2 | ||
|
|
14d0f4e0f3 | ||
|
|
778f969447 | ||
|
|
79cd8b3d8a | ||
|
|
b4663f12b1 | ||
|
|
b50e02c1e4 | ||
|
|
33b72ce64e | ||
|
|
cf2bf840ba | ||
|
|
bccdac6874 | ||
|
|
e69f9f5d68 | ||
|
|
77a9a9c295 | ||
|
|
84dcd1c4e4 | ||
|
|
971e3b7520 | ||
|
|
4e79011729 | ||
|
|
a936ac321c | ||
|
|
98960c911c | ||
|
|
329ca3bef6 | ||
|
|
2c3322e36e | ||
|
|
80ae228b34 | ||
|
|
6d28c408cf | ||
|
|
c83b35d4aa | ||
|
|
94e5d6aedb | ||
|
|
531a74968c | ||
|
|
c5edd147d1 | ||
|
|
856150d056 | ||
|
|
03ebea89b0 | ||
|
|
15d106787e | ||
|
|
7aab3696dd | ||
|
|
47787efa2b | ||
|
|
4a420119a6 | ||
|
|
33751818d3 | ||
|
|
698f127c1a | ||
|
|
fe458b6596 | ||
|
|
21ac1a8ac3 | ||
|
|
79027c0ea0 | ||
|
|
4cad2929cd | ||
|
|
62666af99f | ||
|
|
9ddc289f88 | ||
|
|
6626c214e1 | ||
|
|
d845622b2e | ||
|
|
1058f56e96 | ||
|
|
0434358823 | ||
|
|
3841256c2c | ||
|
|
bdf16f8140 | ||
|
|
836ab0c554 | ||
|
|
6c0376fe4f | ||
|
|
1fa309da40 | ||
|
|
daa0df9e8b | ||
|
|
09728d5fbc | ||
|
|
c16f8a4659 | ||
|
|
a225238530 | ||
|
|
55b2f099c0 | ||
|
|
9631a94fb5 | ||
|
|
cc4444662c | ||
|
|
de3eb07ed6 | ||
|
|
5de008e8c3 | ||
|
|
3e74b444e7 | ||
|
|
e1e0a10c56 | ||
|
|
436214baf7 | ||
|
|
506d0e9693 | ||
|
|
55290788d3 | ||
|
|
bc7e7adf51 | ||
|
|
b0aebe702c | ||
|
|
416878f41f | ||
|
|
c0fed3bda5 | ||
|
|
bb1e44cc8e | ||
|
|
21efee5f8b | ||
|
|
e2713d32f4 | ||
|
|
e21c26daf9 | ||
|
|
1594a4932f | ||
|
|
6869d634c6 | ||
|
|
50918c4ee0 | ||
|
|
6c33d24b46 | ||
|
|
be6217b261 | ||
|
|
9d51a0a9a1 | ||
|
|
39da509f67 | ||
|
|
a479b8f687 | ||
|
|
48a5eabc48 | ||
|
|
11380753b5 | ||
|
|
411c590a1f | ||
|
|
6da8d7de69 | ||
|
|
c6308b3153 | ||
|
|
fc0a45fa41 | ||
|
|
e6e90515db | ||
|
|
22a0a95247 | ||
|
|
50ce1c331c | ||
|
|
7264e38591 | ||
|
|
33d9f3707c | ||
|
|
a26a9d6239 | ||
|
|
a4a8201c02 | ||
|
|
a6571f1073 | ||
|
|
57b6e9652e | ||
|
|
3d9b3605a3 | ||
|
|
74193838f7 | ||
|
|
fb94e260b5 | ||
|
|
345dec937f | ||
|
|
4315f74fa8 | ||
|
|
e67f688025 | ||
|
|
db59b37d0b | ||
|
|
244fe977fe | ||
|
|
7b0d1c2859 | ||
|
|
21d0a8e48b | ||
|
|
47f12ad3e3 | ||
|
|
8f1aaa97a1 | ||
|
|
9d78524cbe | ||
|
|
bc270284b5 | ||
|
|
c93b4eaceb | ||
|
|
71b9cb3107 | ||
|
|
633b444fd2 | ||
|
|
51c4d85ce7 | ||
|
|
631d4c87ee | ||
|
|
1e236d7e23 | ||
|
|
2c34735267 | ||
|
|
39b32571df | ||
|
|
db56f281d9 | ||
|
|
e92b552a10 | ||
|
|
1ae6c83bce | ||
|
|
0fc832e1b2 | ||
|
|
7def35712a | ||
|
|
cad88f96dc | ||
|
|
762d44c956 | ||
|
|
4d8856d511 | ||
|
|
c917106be4 | ||
|
|
76e9cd7f24 | ||
|
|
bf4c6a38e1 | ||
|
|
7f3c3dfa52 | ||
|
|
9c3c447eb3 | ||
|
|
ad73083ff0 | ||
|
|
1e8b59243f | ||
|
|
c88270271e | ||
|
|
b96f007eeb | ||
|
|
9a4aec8b7e | ||
|
|
54fb199681 | ||
|
|
8c32e5dc32 | ||
|
|
0ea590076f | ||
|
|
4a684895c0 | ||
|
|
f4e4aa9b6b | ||
|
|
5e3856a2c5 | ||
|
|
6e6b9f600f | ||
|
|
6a1df4fb5f | ||
|
|
dde1ce7c06 | ||
|
|
811586ebcf | ||
|
|
0ff3749bfe | ||
|
|
28bab13348 | ||
|
|
877032314f | ||
|
|
e7d85c4ef7 | ||
|
|
8ec2b2c41c | ||
|
|
197a5da1d0 | ||
|
|
abbb2938fa | ||
|
|
f657b1a5f2 | ||
|
|
86a52881c6 | ||
|
|
8267423652 | ||
|
|
917a3196f8 | ||
|
|
56bd028a0f | ||
|
|
681b923b5c | ||
|
|
9ed6d8c6c5 | ||
|
|
f3fb420b82 | ||
|
|
165e3561e9 | ||
|
|
27f17c0eab | ||
|
|
44c8892369 | ||
|
|
f574103d7c | ||
|
|
6d138e98e3 | ||
|
|
2a329110b9 | ||
|
|
2bee7b25f3 | ||
|
|
92cf872a48 | ||
|
|
6461f2b7ec | ||
|
|
807cf7b07f | ||
|
|
de7d76af52 | ||
|
|
11c70deba7 | ||
|
|
f36532404d | ||
|
|
77b8b4e696 | ||
|
|
2615fa7584 | ||
|
|
3a686853e1 | ||
|
|
949fc42e00 | ||
|
|
33a1ff7113 | ||
|
|
bec2c14f2c | ||
|
|
37f972954d | ||
|
|
3874e6ea66 | ||
|
|
fac2af3c51 | ||
|
|
6f8cb24219 | ||
|
|
448bb5f333 | ||
|
|
293c255688 | ||
|
|
ac88d2316e | ||
|
|
5950cb1d6d | ||
|
|
761052db92 | ||
|
|
240b60453e | ||
|
|
85b0fe7d64 | ||
|
|
0a5685b26f | ||
|
|
6f748df43f | ||
|
|
b410cb83d4 | ||
|
|
da9d82840a | ||
|
|
4ee0b8afdb | ||
|
|
1de32771e1 | ||
|
|
688c634b7d | ||
|
|
0d6ee97508 | ||
|
|
6b43132ce9 | ||
|
|
a4690b3244 | ||
|
|
444417edb5 | ||
|
|
277c7465f5 | ||
|
|
25bcd3550e | ||
|
|
a4760d204f | ||
|
|
e8593f346a | ||
|
|
05b651e3a5 | ||
|
|
42a7439717 | ||
|
|
b1e9ebd080 | ||
|
|
0c50eeb987 | ||
|
|
4b464a6a78 | ||
|
|
5db9df622f | ||
|
|
5181759c0d | ||
|
|
e54373204a | ||
|
|
102810ef04 | ||
|
|
78d3b3e213 | ||
|
|
7a46542f97 | ||
|
|
eb7941e3e6 | ||
|
|
db3b8b2103 | ||
|
|
c5f5155100 | ||
|
|
4a12077855 | ||
|
|
a4a7c44bd3 | ||
|
|
70346165fe | ||
|
|
c776b99691 | ||
|
|
e9297256d4 | ||
|
|
e5871c672b | ||
|
|
9b06b0fb92 | ||
|
|
4f3a25c2b4 | ||
|
|
21a19aa94d | ||
|
|
c6b9cf05e1 | ||
|
|
4d8819d249 | ||
|
|
898f4b49cc | ||
|
|
0150a00f33 | ||
|
|
c8831015f4 | ||
|
|
92d221ad48 | ||
|
|
0db9a05f88 | ||
|
|
e03b35b8f9 | ||
|
|
d2fee3c99e | ||
|
|
598869afb1 | ||
|
|
7e642e4fd6 | ||
|
|
c8cc3745fb | ||
|
|
4c718d3c50 | ||
|
|
115c65793a | ||
|
|
661d46b28f | ||
|
|
5ce3d5bd1b | ||
|
|
612b5f403e | ||
|
|
9f54e692d2 | ||
|
|
7b2fcbfd4e | ||
|
|
16da9bbc29 | ||
|
|
c8602b2f9b | ||
|
|
b219f5e51b | ||
|
|
1846e9ade0 | ||
|
|
6756602be6 | ||
|
|
6c114b1210 | ||
|
|
7ded6545ed | ||
|
|
aa5957ac49 | ||
|
|
64413f7563 | ||
|
|
45f160a43c | ||
|
|
36ca2c55db | ||
|
|
f0c96af9cb | ||
|
|
31a70191e7 | ||
|
|
ad96b4c8f5 | ||
|
|
043dc9d36f | ||
|
|
52f7c75cff | ||
|
|
f6e588afc0 | ||
|
|
a001296703 | ||
|
|
2cbd8c6781 | ||
|
|
8585dc4cdc | ||
|
|
dd81769c62 | ||
|
|
46bc9b7d7c | ||
|
|
b78531a36a | ||
|
|
11e6a0b641 | ||
|
|
15cda1ef77 | ||
|
|
055f0d3d06 | ||
|
|
cdd94c2eae | ||
|
|
36755d9d69 | ||
|
|
f7199423e5 | ||
|
|
a0a81918f1 | ||
|
|
5572d598a5 | ||
|
|
cec9727c7f | ||
|
|
79298173c5 | ||
|
|
69c9cc2716 | ||
|
|
ed56f26039 | ||
|
|
6f41b2bcf1 | ||
|
|
cda6d47aad | ||
|
|
5d39176f6d | ||
|
|
5c86bfe70f | ||
|
|
364cf465dd | ||
|
|
ca950f49e9 | ||
|
|
89ac4a19e6 | ||
|
|
640eea0a0c | ||
|
|
bd1e484448 | ||
|
|
a834622b89 | ||
|
|
707bb426b1 | ||
|
|
66e7ace17a | ||
|
|
791ff52f75 | ||
|
|
98d560f205 | ||
|
|
afcc317800 | ||
|
|
b5abf86148 | ||
|
|
134c6ea856 | ||
|
|
0730be9022 | ||
|
|
96c2e3e909 | ||
|
|
f196508f7b | ||
|
|
cc1028aa6d | ||
|
|
ad55e10165 | ||
|
|
18cf6381f6 | ||
|
|
cdf32ff15d | ||
|
|
99d79b8692 | ||
|
|
b9e7bc55da | ||
|
|
d8d540cf0d | ||
|
|
0df79d552a | ||
|
|
0db3a66162 | ||
|
|
7581bfc958 | ||
|
|
f388f616c1 | ||
|
|
a3fa6024d6 | ||
|
|
1b405bb47d | ||
|
|
7e8ddca1bb | ||
|
|
778a1ccca7 | ||
|
|
4540515cb3 | ||
|
|
e0741fd449 | ||
|
|
e73b9c65e2 | ||
|
|
702ccf2dc0 | ||
|
|
28b4f73620 | ||
|
|
c2876afafe | ||
|
|
6ddb4888d2 | ||
|
|
fa5cb8d021 | ||
|
|
e21f17fc86 | ||
|
|
edaa23f822 | ||
|
|
d5ae6bb501 | ||
|
|
51fb4995a5 | ||
|
|
9e9cd7248d | ||
|
|
72f3289ac4 | ||
|
|
71aff18809 | ||
|
|
dab0daeeb0 | ||
|
|
4350b74545 | ||
|
|
2937590e8b | ||
|
|
fad7bbec3a | ||
|
|
e62d9c5caa | ||
|
|
20cfdcc910 | ||
|
|
1292638754 | ||
|
|
fe40f9eef2 | ||
|
|
6104cc2985 | ||
|
|
c15c47d19b | ||
|
|
965fefdcd8 | ||
|
|
3951e7eb93 | ||
|
|
f1f6f5aa5e | ||
|
|
eb785b856f | ||
|
|
c52f4efaee | ||
|
|
f23a92a0ce | ||
|
|
3b01a9fbb6 | ||
|
|
93fdb14177 | ||
|
|
370d4eb8ad | ||
|
|
3452c3a27c | ||
|
|
9c072d38c6 | ||
|
|
81f35fee2f | ||
|
|
0fdbe3146c | ||
|
|
3e169233da | ||
|
|
f5436c5d9e | ||
|
|
5c24873a9e | ||
|
|
00c21c225d | ||
|
|
d013b26719 | ||
|
|
e2eca6f65e | ||
|
|
a0904c5d80 | ||
|
|
cb1fa58813 | ||
|
|
3fd6332c05 | ||
|
|
401d147893 | ||
|
|
e2ee97dcd5 | ||
|
|
f745403b5b | ||
|
|
3e80e6f40d | ||
|
|
25cb7a0eeb | ||
|
|
abc97b5eda | ||
|
|
04e88ca2ca | ||
|
|
8d93c21466 | ||
|
|
1dbfd78754 | ||
|
|
22e35adefd | ||
|
|
6f59aa934b | ||
|
|
109db8ea64 | ||
|
|
833b644fff | ||
|
|
915620fd68 | ||
|
|
ac12e888f9 | ||
|
|
b1c6a5bac8 | ||
|
|
7d08f6073d | ||
|
|
758a059241 | ||
|
|
4f8c56eb4e | ||
|
|
57cf9b7f06 | ||
|
|
9da526aae7 | ||
|
|
75b81df3af | ||
|
|
aabdc83d6e | ||
|
|
2a48e6f01a | ||
|
|
203a3c0e6a | ||
|
|
d36724cca4 | ||
|
|
15fc0658f7 | ||
|
|
e960c3c223 | ||
|
|
bc7e77a04b | ||
|
|
964f49336f | ||
|
|
57d8e32a3e | ||
|
|
4174552391 | ||
|
|
80bc4106af | ||
|
|
7759be38da | ||
|
|
a0a309b973 | ||
|
|
c587cbb793 | ||
|
|
6c52a86f54 | ||
|
|
8a92e51c60 | ||
|
|
f0e14fdd43 | ||
|
|
df5f4e8888 | ||
|
|
7960b0563b | ||
|
|
5c9ced9504 | ||
|
|
31c4448f6e | ||
|
|
79a2e94e79 | ||
|
|
686cc89634 | ||
|
|
9508738f9a | ||
|
|
78a3ff33ab | ||
|
|
881dbc86c4 | ||
|
|
8e7d004888 | ||
|
|
9618c44824 | ||
|
|
516ea41a7d | ||
|
|
e2bd301ce7 | ||
|
|
0c9d288ba0 | ||
|
|
e0da32df6e | ||
|
|
174aba3223 | ||
|
|
0d66bd0eab | ||
|
|
4bd143a3a0 | ||
|
|
6f27bf1c74 | ||
|
|
68bb2fef95 | ||
|
|
854cc54bc1 | ||
|
|
651ad35ce0 | ||
|
|
6a0f9a24d0 | ||
|
|
9cf79e8f4b | ||
|
|
2844b09336 | ||
|
|
1a2b377cc2 | ||
|
|
4c1b2e5c0e | ||
|
|
9e1b96ae40 | ||
|
|
fc35cd9e0c | ||
|
|
339fe7228a | ||
|
|
ea7e7fecbd | ||
|
|
d00b93d58c | ||
|
|
93f7a31bf3 | ||
|
|
33a1ec950c | ||
|
|
4e0c0c1508 | ||
|
|
89c0dc9a5f | ||
|
|
f628d800fb | ||
|
|
11fa3d7f99 | ||
|
|
d41ee7b774 | ||
|
|
e0e9bbb0e9 | ||
|
|
7691184a31 | ||
|
|
35cd2f4c25 | ||
|
|
350d7963db | ||
|
|
cbc032c8b7 | ||
|
|
69c4cde4ba | ||
|
|
ca278a182b | ||
|
|
373e1230e4 | ||
|
|
cd63d091ce | ||
|
|
0571ffda7d | ||
|
|
5556047465 | ||
|
|
65a3bfb379 | ||
|
|
cef3f3011f | ||
|
|
e9c6cdf4a1 | ||
|
|
00a17a9e12 | ||
|
|
8312b1a3d1 | ||
|
|
6ff4469528 | ||
|
|
68835d687a | ||
|
|
9d186afac8 | ||
|
|
151d98130b | ||
|
|
b24d6336a7 | ||
|
|
065216d94f | ||
|
|
67167920db | ||
|
|
14638e2915 | ||
|
|
1910077ed7 | ||
|
|
5819edef03 | ||
|
|
f5535ed0e3 | ||
|
|
31ff3c074e | ||
|
|
72670c39de | ||
|
|
683d892bf9 | ||
|
|
497971cd4a | ||
|
|
e757fb3d05 | ||
|
|
0ba9e3ca22 | ||
|
|
4b53762914 | ||
|
|
eebe6b382e | ||
|
|
0cbcbdd89d | ||
|
|
7f776fa4b5 | ||
|
|
eb5ad31ce1 | ||
|
|
a5941305b6 | ||
|
|
f8dddaf456 | ||
|
|
618c71dc64 | ||
|
|
52af8f222b | ||
|
|
3cc8649c9d | ||
|
|
dcf094d626 | ||
|
|
5b5d7cc11e | ||
|
|
2ac2cbc0a3 | ||
|
|
a7e03861e8 | ||
|
|
046ea04a7d | ||
|
|
7464360379 | ||
|
|
175c2e9ec3 | ||
|
|
f1f879098a | ||
|
|
c9fd530670 | ||
|
|
749b0046a8 | ||
|
|
e3de3d6f2f | ||
|
|
ad58942d57 | ||
|
|
4645432d7a | ||
|
|
6bdc2d5358 | ||
|
|
2beff95da5 | ||
|
|
abc1723edd | ||
|
|
b248e6485b | ||
|
|
d6712378e7 | ||
|
|
fb72ec58ae | ||
|
|
c83a352227 | ||
|
|
e9063b5de9 | ||
|
|
594b0c4c69 | ||
|
|
eb9ee19422 | ||
|
|
a1394b820d | ||
|
|
aa9dc24f5a | ||
|
|
51762e1a31 | ||
|
|
8b38f2ac40 | ||
|
|
a82398bd72 | ||
|
|
c14dc00df3 | ||
|
|
03dd60ca41 | ||
|
|
0738187f9b | ||
|
|
a956cb6306 | ||
|
|
a8062eabcd | ||
|
|
2a7dee8cc5 | ||
|
|
d9ed362116 | ||
|
|
4f54958097 | ||
|
|
2a7c38831c | ||
|
|
949b6497cc | ||
|
|
2c21152ca7 | ||
|
|
fda9a1ca9e | ||
|
|
864d5e7231 | ||
|
|
5448b781f6 | ||
|
|
e239413fbc | ||
|
|
fd0ff8bad8 | ||
|
|
397ec446f3 | ||
|
|
14f7a2b8af | ||
|
|
c0837a12c8 | ||
|
|
29a7e8f6f8 | ||
|
|
eb01e97e10 | ||
|
|
cb7d4d0efd | ||
|
|
c80037918b | ||
|
|
237a41108a | ||
|
|
e962ae15d3 | ||
|
|
7c36ea7d54 | ||
|
|
9260cf1d97 | ||
|
|
bdbb8530c7 | ||
|
|
09a9fadb84 | ||
|
|
bf09af3acb | ||
|
|
88296ac326 | ||
|
|
870d525848 | ||
|
|
6577112890 | ||
|
|
1988647dda | ||
|
|
a292cba256 | ||
|
|
982e518a96 | ||
|
|
748e730099 | ||
|
|
b6c0d4f431 | ||
|
|
acaff49575 | ||
|
|
1da19488f9 | ||
|
|
442c4d361f | ||
|
|
ec59d657e7 | ||
|
|
99ef96f84c | ||
|
|
4dccea8ad0 | ||
|
|
2c0d9c6217 | ||
|
|
12a5134596 | ||
|
|
16e633a5d7 | ||
|
|
494ab6db73 | ||
|
|
107701fcfc | ||
|
|
f77970765a | ||
|
|
81215d5652 | ||
|
|
241a318f27 | ||
|
|
4fdf082375 | ||
|
|
1b6182d8f7 | ||
|
|
7bab22a402 | ||
|
|
0f97fb4d00 | ||
|
|
b1cf58f48f | ||
|
|
3014b0ae83 | ||
|
|
b9f2fdd37f | ||
|
|
bbb3f730bb | ||
|
|
d868f43c58 | ||
|
|
21525bb8ca | ||
|
|
d8f103159f | ||
|
|
663ee5f0a9 | ||
|
|
b6b950bf58 | ||
|
|
11e60fcad8 | ||
|
|
c23533a100 | ||
|
|
0dafea02e6 | ||
|
|
5d6360c3b7 | ||
|
|
5e5c30c3fd | ||
|
|
9154c87fc4 | ||
|
|
ef0e4e7bc0 | ||
|
|
67d46a3f90 | ||
|
|
bec47a0748 | ||
|
|
36b7d9dbfa | ||
|
|
8c65e4a527 | ||
|
|
6ad2ef8b7c | ||
|
|
00b426d66d | ||
|
|
0de968b584 | ||
|
|
0841d5013c | ||
|
|
a71fca8577 | ||
|
|
ee94e7e66d | ||
|
|
759e37c9e6 | ||
|
|
ae65567102 | ||
|
|
c394b4f4cb | ||
|
|
260c7036ba | ||
|
|
f74197a074 | ||
|
|
f3a58d46bf | ||
|
|
b6612c9b11 | ||
|
|
7e176effb2 | ||
|
|
4a252cc2d2 | ||
|
|
f0ec61b525 | ||
|
|
66d40ae3a5 | ||
|
|
e6da9240d4 | ||
|
|
dd91dfcd67 | ||
|
|
c773082692 | ||
|
|
9c250931f5 | ||
|
|
56f1750049 | ||
|
|
f2159c9815 | ||
|
|
b0cf2e7c1b | ||
|
|
74b47d00c3 | ||
|
|
8cb57bab8e | ||
|
|
e1bf277e19 | ||
|
|
ce599d5a7e | ||
|
|
9e28538726 | ||
|
|
404284132c | ||
|
|
5565be9dd9 | ||
|
|
b3a9474ad1 | ||
|
|
86475d59b1 | ||
|
|
73d93f948e | ||
|
|
f5d8743e0a | ||
|
|
d1c4e4ba15 | ||
|
|
f141fefab7 | ||
|
|
8334637f4a | ||
|
|
b0ba11cc64 | ||
|
|
b8f67449ec | ||
|
|
75af5d59ae | ||
|
|
b969d12490 | ||
|
|
6d67169509 | ||
|
|
dcaf00fb3e | ||
|
|
f896e1ccef | ||
|
|
c96eca426b | ||
|
|
466a614537 | ||
|
|
ffa2cecf72 | ||
|
|
a837416025 | ||
|
|
c9d448876f | ||
|
|
8865b8abfd | ||
|
|
c77a0c01cb | ||
|
|
12355ac473 | ||
|
|
49f523ca50 | ||
|
|
4a903b93a9 | ||
|
|
13267a2be3 | ||
|
|
134c207e3f | ||
|
|
0f56bd2178 | ||
|
|
dfbc7f7f3f | ||
|
|
7d58ea7c5b | ||
|
|
452908b257 | ||
|
|
5899e988d5 | ||
|
|
4a121d29bb | ||
|
|
7ebc36900d | ||
|
|
d7eb052fa2 | ||
|
|
a6d6722c8f | ||
|
|
66fa495868 | ||
|
|
443285aabe | ||
|
|
de728757ad | ||
|
|
f44c276842 | ||
|
|
a1fa60a934 | ||
|
|
49caf3307f | ||
|
|
6a801f4470 | ||
|
|
61dd350a04 | ||
|
|
eb9c3edd5e | ||
|
|
95153a960d | ||
|
|
6c4c7539f2 | ||
|
|
c991106706 | ||
|
|
dae2a058de | ||
|
|
c05025fdd7 | ||
|
|
bfe96d7bea | ||
|
|
ab481b48e5 | ||
|
|
92c7f3157a | ||
|
|
cacd996662 | ||
|
|
bffb245a48 | ||
|
|
680efb6723 | ||
|
|
5a9858bfa9 | ||
|
|
8a5dc1c1e1 | ||
|
|
e0986e31cf | ||
|
|
6b97ca96fc | ||
|
|
c1ce6acdd7 | ||
|
|
0d778b1db9 | ||
|
|
779822d945 | ||
|
|
1b3d5e05a8 | ||
|
|
e52d7f85f2 | ||
|
|
568d2f78d6 | ||
|
|
2f2fcf1a33 | ||
|
|
bacec0397f | ||
|
|
3c6c7e7d7e | ||
|
|
fb38aa8b53 | ||
|
|
18da24634c | ||
|
|
a134426d61 | ||
|
|
a64c0c9b06 | ||
|
|
56019444cb | ||
|
|
a1ff3cd5f9 | ||
|
|
9a32e80477 | ||
|
|
536a55dabd | ||
|
|
ed6fb8b804 | ||
|
|
3afef2e3fc | ||
|
|
e90d175436 | ||
|
|
7a93ab5f3f |
6
.github/ISSUE_TEMPLATE.md
vendored
6
.github/ISSUE_TEMPLATE.md
vendored
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2016.04.06*. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
|
### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2016.07.03*. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
|
||||||
- [ ] I've **verified** and **I assure** that I'm running youtube-dl **2016.04.06**
|
- [ ] I've **verified** and **I assure** that I'm running youtube-dl **2016.07.03**
|
||||||
|
|
||||||
### Before submitting an *issue* make sure you have:
|
### Before submitting an *issue* make sure you have:
|
||||||
- [ ] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
|
- [ ] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
|
||||||
@@ -35,7 +35,7 @@ $ youtube-dl -v <your command line>
|
|||||||
[debug] User config: []
|
[debug] User config: []
|
||||||
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
|
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
|
||||||
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
|
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
|
||||||
[debug] youtube-dl version 2016.04.06
|
[debug] youtube-dl version 2016.07.03
|
||||||
[debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
|
[debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
|
||||||
[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
|
[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
|
||||||
[debug] Proxy map: {}
|
[debug] Proxy map: {}
|
||||||
|
|||||||
9
.gitignore
vendored
9
.gitignore
vendored
@@ -13,6 +13,7 @@ README.txt
|
|||||||
youtube-dl.1
|
youtube-dl.1
|
||||||
youtube-dl.bash-completion
|
youtube-dl.bash-completion
|
||||||
youtube-dl.fish
|
youtube-dl.fish
|
||||||
|
youtube_dl/extractor/lazy_extractors.py
|
||||||
youtube-dl
|
youtube-dl
|
||||||
youtube-dl.exe
|
youtube-dl.exe
|
||||||
youtube-dl.tar.gz
|
youtube-dl.tar.gz
|
||||||
@@ -27,10 +28,16 @@ updates_key.pem
|
|||||||
*.mp4
|
*.mp4
|
||||||
*.m4a
|
*.m4a
|
||||||
*.m4v
|
*.m4v
|
||||||
|
*.mp3
|
||||||
*.part
|
*.part
|
||||||
*.swp
|
*.swp
|
||||||
test/testdata
|
test/testdata
|
||||||
|
test/local_parameters.json
|
||||||
.tox
|
.tox
|
||||||
youtube-dl.zsh
|
youtube-dl.zsh
|
||||||
|
|
||||||
|
# IntelliJ related files
|
||||||
.idea
|
.idea
|
||||||
.idea/*
|
*.iml
|
||||||
|
|
||||||
|
tmp/
|
||||||
|
|||||||
@@ -7,11 +7,13 @@ python:
|
|||||||
- "3.4"
|
- "3.4"
|
||||||
- "3.5"
|
- "3.5"
|
||||||
sudo: false
|
sudo: false
|
||||||
|
install:
|
||||||
|
- bash ./devscripts/install_srelay.sh
|
||||||
|
- export PATH=$PATH:$(pwd)/tmp/srelay-0.4.8b6
|
||||||
script: nosetests test --verbose
|
script: nosetests test --verbose
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
- filippo.valsorda@gmail.com
|
- filippo.valsorda@gmail.com
|
||||||
- phihag@phihag.de
|
|
||||||
- yasoob.khld@gmail.com
|
- yasoob.khld@gmail.com
|
||||||
# irc:
|
# irc:
|
||||||
# channels:
|
# channels:
|
||||||
|
|||||||
10
AUTHORS
10
AUTHORS
@@ -167,3 +167,13 @@ Kacper Michajłow
|
|||||||
José Joaquín Atria
|
José Joaquín Atria
|
||||||
Viťas Strádal
|
Viťas Strádal
|
||||||
Kagami Hiiragi
|
Kagami Hiiragi
|
||||||
|
Philip Huppert
|
||||||
|
blahgeek
|
||||||
|
Kevin Deldycke
|
||||||
|
inondle
|
||||||
|
Tomáš Čech
|
||||||
|
Déstin Reed
|
||||||
|
Roman Tsiupa
|
||||||
|
Artur Krysiak
|
||||||
|
Jakub Adam Wieczorek
|
||||||
|
Aleksandar Topuzović
|
||||||
|
|||||||
@@ -140,14 +140,14 @@ After you have ensured this site is distributing it's content legally, you can f
|
|||||||
# TODO more properties (see youtube_dl/extractor/common.py)
|
# TODO more properties (see youtube_dl/extractor/common.py)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
5. Add an import in [`youtube_dl/extractor/__init__.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/__init__.py).
|
5. Add an import in [`youtube_dl/extractor/extractors.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/extractors.py).
|
||||||
6. Run `python test/test_download.py TestDownload.test_YourExtractor`. This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename ``_TEST`` to ``_TESTS`` and make it into a list of dictionaries. The tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc.
|
6. Run `python test/test_download.py TestDownload.test_YourExtractor`. This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename ``_TEST`` to ``_TESTS`` and make it into a list of dictionaries. The tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc.
|
||||||
7. Have a look at [`youtube_dl/extractor/common.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py) for possible helper methods and a [detailed description of what your extractor should and may return](https://github.com/rg3/youtube-dl/blob/58525c94d547be1c8167d16c298bdd75506db328/youtube_dl/extractor/common.py#L68-L226). Add tests and code for as many as you want.
|
7. Have a look at [`youtube_dl/extractor/common.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py) for possible helper methods and a [detailed description of what your extractor should and may return](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L74-L252). Add tests and code for as many as you want.
|
||||||
8. Keep in mind that the only mandatory fields in info dict for successful extraction process are `id`, `title` and either `url` or `formats`, i.e. these are the critical data the extraction does not make any sense without. This means that [any field](https://github.com/rg3/youtube-dl/blob/58525c94d547be1c8167d16c298bdd75506db328/youtube_dl/extractor/common.py#L138-L226) apart from aforementioned mandatory ones should be treated **as optional** and extraction should be **tolerate** to situations when sources for these fields can potentially be unavailable (even if they always available at the moment) and **future-proof** in order not to break the extraction of general purpose mandatory fields. For example, if you have some intermediate dict `meta` that is a source of metadata and it has a key `summary` that you want to extract and put into resulting info dict as `description`, you should be ready that this key may be missing from the `meta` dict, i.e. you should extract it as `meta.get('summary')` and not `meta['summary']`. Similarly, you should pass `fatal=False` when extracting data from a webpage with `_search_regex/_html_search_regex`.
|
8. Keep in mind that the only mandatory fields in info dict for successful extraction process are `id`, `title` and either `url` or `formats`, i.e. these are the critical data the extraction does not make any sense without. This means that [any field](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L148-L252) apart from aforementioned mandatory ones should be treated **as optional** and extraction should be **tolerate** to situations when sources for these fields can potentially be unavailable (even if they always available at the moment) and **future-proof** in order not to break the extraction of general purpose mandatory fields. For example, if you have some intermediate dict `meta` that is a source of metadata and it has a key `summary` that you want to extract and put into resulting info dict as `description`, you should be ready that this key may be missing from the `meta` dict, i.e. you should extract it as `meta.get('summary')` and not `meta['summary']`. Similarly, you should pass `fatal=False` when extracting data from a webpage with `_search_regex/_html_search_regex`.
|
||||||
9. Check the code with [flake8](https://pypi.python.org/pypi/flake8).
|
9. Check the code with [flake8](https://pypi.python.org/pypi/flake8). Also make sure your code works under all [Python](http://www.python.org/) versions claimed supported by youtube-dl, namely 2.6, 2.7, and 3.2+.
|
||||||
10. When the tests pass, [add](http://git-scm.com/docs/git-add) the new files and [commit](http://git-scm.com/docs/git-commit) them and [push](http://git-scm.com/docs/git-push) the result, like this:
|
10. When the tests pass, [add](http://git-scm.com/docs/git-add) the new files and [commit](http://git-scm.com/docs/git-commit) them and [push](http://git-scm.com/docs/git-push) the result, like this:
|
||||||
|
|
||||||
$ git add youtube_dl/extractor/__init__.py
|
$ git add youtube_dl/extractor/extractors.py
|
||||||
$ git add youtube_dl/extractor/yourextractor.py
|
$ git add youtube_dl/extractor/yourextractor.py
|
||||||
$ git commit -m '[yourextractor] Add new extractor'
|
$ git commit -m '[yourextractor] Add new extractor'
|
||||||
$ git push origin yourextractor
|
$ git push origin yourextractor
|
||||||
|
|||||||
12
Makefile
12
Makefile
@@ -1,7 +1,7 @@
|
|||||||
all: youtube-dl README.md CONTRIBUTING.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish supportedsites
|
all: youtube-dl README.md CONTRIBUTING.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish supportedsites
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf youtube-dl.1.temp.md youtube-dl.1 youtube-dl.bash-completion README.txt MANIFEST build/ dist/ .coverage cover/ youtube-dl.tar.gz youtube-dl.zsh youtube-dl.fish *.dump *.part *.info.json *.mp4 *.flv *.mp3 *.avi CONTRIBUTING.md.tmp ISSUE_TEMPLATE.md.tmp youtube-dl youtube-dl.exe
|
rm -rf youtube-dl.1.temp.md youtube-dl.1 youtube-dl.bash-completion README.txt MANIFEST build/ dist/ .coverage cover/ youtube-dl.tar.gz youtube-dl.zsh youtube-dl.fish youtube_dl/extractor/lazy_extractors.py *.dump *.part *.info.json *.mp4 *.m4a *.flv *.mp3 *.avi *.mkv *.webm *.jpg *.png CONTRIBUTING.md.tmp ISSUE_TEMPLATE.md.tmp youtube-dl youtube-dl.exe
|
||||||
find . -name "*.pyc" -delete
|
find . -name "*.pyc" -delete
|
||||||
find . -name "*.class" -delete
|
find . -name "*.class" -delete
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ test:
|
|||||||
ot: offlinetest
|
ot: offlinetest
|
||||||
|
|
||||||
offlinetest: codetest
|
offlinetest: codetest
|
||||||
$(PYTHON) -m nose --verbose test --exclude test_download.py --exclude test_age_restriction.py --exclude test_subtitles.py --exclude test_write_annotations.py --exclude test_youtube_lists.py --exclude test_iqiyi_sdk_interpreter.py
|
$(PYTHON) -m nose --verbose test --exclude test_download.py --exclude test_age_restriction.py --exclude test_subtitles.py --exclude test_write_annotations.py --exclude test_youtube_lists.py --exclude test_iqiyi_sdk_interpreter.py --exclude test_socks.py
|
||||||
|
|
||||||
tar: youtube-dl.tar.gz
|
tar: youtube-dl.tar.gz
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ README.txt: README.md
|
|||||||
pandoc -f markdown -t plain README.md -o README.txt
|
pandoc -f markdown -t plain README.md -o README.txt
|
||||||
|
|
||||||
youtube-dl.1: README.md
|
youtube-dl.1: README.md
|
||||||
$(PYTHON) devscripts/prepare_manpage.py >youtube-dl.1.temp.md
|
$(PYTHON) devscripts/prepare_manpage.py youtube-dl.1.temp.md
|
||||||
pandoc -s -f markdown -t man youtube-dl.1.temp.md -o youtube-dl.1
|
pandoc -s -f markdown -t man youtube-dl.1.temp.md -o youtube-dl.1
|
||||||
rm -f youtube-dl.1.temp.md
|
rm -f youtube-dl.1.temp.md
|
||||||
|
|
||||||
@@ -88,6 +88,12 @@ youtube-dl.fish: youtube_dl/*.py youtube_dl/*/*.py devscripts/fish-completion.in
|
|||||||
|
|
||||||
fish-completion: youtube-dl.fish
|
fish-completion: youtube-dl.fish
|
||||||
|
|
||||||
|
lazy-extractors: youtube_dl/extractor/lazy_extractors.py
|
||||||
|
|
||||||
|
_EXTRACTOR_FILES != find youtube_dl/extractor -iname '*.py' -and -not -iname 'lazy_extractors.py'
|
||||||
|
youtube_dl/extractor/lazy_extractors.py: devscripts/make_lazy_extractors.py devscripts/lazy_load_template.py $(_EXTRACTOR_FILES)
|
||||||
|
$(PYTHON) devscripts/make_lazy_extractors.py $@
|
||||||
|
|
||||||
youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish
|
youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish
|
||||||
@tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \
|
@tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \
|
||||||
--exclude '*.DS_Store' \
|
--exclude '*.DS_Store' \
|
||||||
|
|||||||
110
README.md
110
README.md
@@ -17,7 +17,7 @@ youtube-dl - download videos from youtube.com or other video platforms
|
|||||||
|
|
||||||
To install it right away for all UNIX users (Linux, OS X, etc.), type:
|
To install it right away for all UNIX users (Linux, OS X, etc.), type:
|
||||||
|
|
||||||
sudo curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl
|
sudo curl -L https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl
|
||||||
sudo chmod a+rx /usr/local/bin/youtube-dl
|
sudo chmod a+rx /usr/local/bin/youtube-dl
|
||||||
|
|
||||||
If you do not have curl, you can alternatively use a recent wget:
|
If you do not have curl, you can alternatively use a recent wget:
|
||||||
@@ -25,20 +25,26 @@ If you do not have curl, you can alternatively use a recent wget:
|
|||||||
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
|
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
|
||||||
sudo chmod a+rx /usr/local/bin/youtube-dl
|
sudo chmod a+rx /usr/local/bin/youtube-dl
|
||||||
|
|
||||||
Windows users can [download a .exe file](https://yt-dl.org/latest/youtube-dl.exe) and place it in their home directory or any other location on their [PATH](http://en.wikipedia.org/wiki/PATH_%28variable%29).
|
Windows users can [download an .exe file](https://yt-dl.org/latest/youtube-dl.exe) and place it in any location on their [PATH](http://en.wikipedia.org/wiki/PATH_%28variable%29) except for `%SYSTEMROOT%\System32` (e.g. **do not** put in `C:\Windows\System32`).
|
||||||
|
|
||||||
OS X users can install **youtube-dl** with [Homebrew](http://brew.sh/).
|
|
||||||
|
|
||||||
brew install youtube-dl
|
|
||||||
|
|
||||||
You can also use pip:
|
You can also use pip:
|
||||||
|
|
||||||
sudo pip install youtube-dl
|
sudo pip install --upgrade youtube-dl
|
||||||
|
|
||||||
|
This command will update youtube-dl if you have already installed it. See the [pypi page](https://pypi.python.org/pypi/youtube_dl) for more information.
|
||||||
|
|
||||||
|
OS X users can install youtube-dl with [Homebrew](http://brew.sh/):
|
||||||
|
|
||||||
|
brew install youtube-dl
|
||||||
|
|
||||||
|
Or with [MacPorts](https://www.macports.org/):
|
||||||
|
|
||||||
|
sudo port install youtube-dl
|
||||||
|
|
||||||
Alternatively, refer to the [developer instructions](#developer-instructions) for how to check out and work with the git repository. For further options, including PGP signatures, see the [youtube-dl Download Page](https://rg3.github.io/youtube-dl/download.html).
|
Alternatively, refer to the [developer instructions](#developer-instructions) for how to check out and work with the git repository. For further options, including PGP signatures, see the [youtube-dl Download Page](https://rg3.github.io/youtube-dl/download.html).
|
||||||
|
|
||||||
# DESCRIPTION
|
# DESCRIPTION
|
||||||
**youtube-dl** is a small command-line program to download videos from
|
**youtube-dl** is a command-line program to download videos from
|
||||||
YouTube.com and a few more sites. It requires the Python interpreter, version
|
YouTube.com and a few more sites. It requires the Python interpreter, version
|
||||||
2.6, 2.7, or 3.2+, and it is not platform specific. It should work on
|
2.6, 2.7, or 3.2+, and it is not platform specific. It should work on
|
||||||
your Unix box, on Windows or on Mac OS X. It is released to the public domain,
|
your Unix box, on Windows or on Mac OS X. It is released to the public domain,
|
||||||
@@ -73,8 +79,8 @@ which means you can modify it, redistribute it or use it however you like.
|
|||||||
repairs broken URLs, but emits an error if
|
repairs broken URLs, but emits an error if
|
||||||
this is not possible instead of searching.
|
this is not possible instead of searching.
|
||||||
--ignore-config Do not read configuration files. When given
|
--ignore-config Do not read configuration files. When given
|
||||||
in the global configuration file /etc
|
in the global configuration file
|
||||||
/youtube-dl.conf: Do not read the user
|
/etc/youtube-dl.conf: Do not read the user
|
||||||
configuration in ~/.config/youtube-
|
configuration in ~/.config/youtube-
|
||||||
dl/config (%APPDATA%/youtube-dl/config.txt
|
dl/config (%APPDATA%/youtube-dl/config.txt
|
||||||
on Windows)
|
on Windows)
|
||||||
@@ -85,9 +91,11 @@ which means you can modify it, redistribute it or use it however you like.
|
|||||||
--no-color Do not emit color codes in output
|
--no-color Do not emit color codes in output
|
||||||
|
|
||||||
## Network Options:
|
## Network Options:
|
||||||
--proxy URL Use the specified HTTP/HTTPS proxy. Pass in
|
--proxy URL Use the specified HTTP/HTTPS/SOCKS proxy.
|
||||||
an empty string (--proxy "") for direct
|
To enable experimental SOCKS proxy, specify
|
||||||
connection
|
a proper scheme. For example
|
||||||
|
socks5://127.0.0.1:1080/. Pass in an empty
|
||||||
|
string (--proxy "") for direct connection
|
||||||
--socket-timeout SECONDS Time to wait before giving up, in seconds
|
--socket-timeout SECONDS Time to wait before giving up, in seconds
|
||||||
--source-address IP Client-side IP address to bind to
|
--source-address IP Client-side IP address to bind to
|
||||||
(experimental)
|
(experimental)
|
||||||
@@ -160,7 +168,7 @@ which means you can modify it, redistribute it or use it however you like.
|
|||||||
(experimental)
|
(experimental)
|
||||||
|
|
||||||
## Download Options:
|
## Download Options:
|
||||||
-r, --rate-limit LIMIT Maximum download rate in bytes per second
|
-r, --limit-rate RATE Maximum download rate in bytes per second
|
||||||
(e.g. 50K or 4.2M)
|
(e.g. 50K or 4.2M)
|
||||||
-R, --retries RETRIES Number of retries (default is 10), or
|
-R, --retries RETRIES Number of retries (default is 10), or
|
||||||
"infinite".
|
"infinite".
|
||||||
@@ -176,7 +184,9 @@ which means you can modify it, redistribute it or use it however you like.
|
|||||||
--xattr-set-filesize Set file xattribute ytdl.filesize with
|
--xattr-set-filesize Set file xattribute ytdl.filesize with
|
||||||
expected filesize (experimental)
|
expected filesize (experimental)
|
||||||
--hls-prefer-native Use the native HLS downloader instead of
|
--hls-prefer-native Use the native HLS downloader instead of
|
||||||
ffmpeg (experimental)
|
ffmpeg
|
||||||
|
--hls-prefer-ffmpeg Use ffmpeg instead of the native HLS
|
||||||
|
downloader
|
||||||
--hls-use-mpegts Use the mpegts container for HLS videos,
|
--hls-use-mpegts Use the mpegts container for HLS videos,
|
||||||
allowing to play the video while
|
allowing to play the video while
|
||||||
downloading (some players may not be able
|
downloading (some players may not be able
|
||||||
@@ -245,18 +255,19 @@ which means you can modify it, redistribute it or use it however you like.
|
|||||||
--write-info-json Write video metadata to a .info.json file
|
--write-info-json Write video metadata to a .info.json file
|
||||||
--write-annotations Write video annotations to a
|
--write-annotations Write video annotations to a
|
||||||
.annotations.xml file
|
.annotations.xml file
|
||||||
--load-info FILE JSON file containing the video information
|
--load-info-json FILE JSON file containing the video information
|
||||||
(created with the "--write-info-json"
|
(created with the "--write-info-json"
|
||||||
option)
|
option)
|
||||||
--cookies FILE File to read cookies from and dump cookie
|
--cookies FILE File to read cookies from and dump cookie
|
||||||
jar in
|
jar in
|
||||||
--cache-dir DIR Location in the filesystem where youtube-dl
|
--cache-dir DIR Location in the filesystem where youtube-dl
|
||||||
can store some downloaded information
|
can store some downloaded information
|
||||||
permanently. By default $XDG_CACHE_HOME
|
permanently. By default
|
||||||
/youtube-dl or ~/.cache/youtube-dl . At the
|
$XDG_CACHE_HOME/youtube-dl or
|
||||||
moment, only YouTube player files (for
|
~/.cache/youtube-dl . At the moment, only
|
||||||
videos with obfuscated signatures) are
|
YouTube player files (for videos with
|
||||||
cached, but that may change.
|
obfuscated signatures) are cached, but that
|
||||||
|
may change.
|
||||||
--no-cache-dir Disable filesystem caching
|
--no-cache-dir Disable filesystem caching
|
||||||
--rm-cache-dir Delete all filesystem cache files
|
--rm-cache-dir Delete all filesystem cache files
|
||||||
|
|
||||||
@@ -413,7 +424,7 @@ which means you can modify it, redistribute it or use it however you like.
|
|||||||
|
|
||||||
# CONFIGURATION
|
# CONFIGURATION
|
||||||
|
|
||||||
You can configure youtube-dl by placing any supported command line option to a configuration file. On Linux, the system wide configuration file is located at `/etc/youtube-dl.conf` and the user wide configuration file at `~/.config/youtube-dl/config`. On Windows, the user wide configuration file locations are `%APPDATA%\youtube-dl\config.txt` or `C:\Users\<user name>\youtube-dl.conf`.
|
You can configure youtube-dl by placing any supported command line option to a configuration file. On Linux and OS X, the system wide configuration file is located at `/etc/youtube-dl.conf` and the user wide configuration file at `~/.config/youtube-dl/config`. On Windows, the user wide configuration file locations are `%APPDATA%\youtube-dl\config.txt` or `C:\Users\<user name>\youtube-dl.conf`.
|
||||||
|
|
||||||
For example, with the following configuration file youtube-dl will always extract the audio, not copy the mtime, use a proxy and save all videos under `Movies` directory in your home directory:
|
For example, with the following configuration file youtube-dl will always extract the audio, not copy the mtime, use a proxy and save all videos under `Movies` directory in your home directory:
|
||||||
```
|
```
|
||||||
@@ -429,7 +440,7 @@ You can use `--ignore-config` if you want to disable the configuration file for
|
|||||||
|
|
||||||
### Authentication with `.netrc` file
|
### Authentication with `.netrc` file
|
||||||
|
|
||||||
You may also want to configure automatic credentials storage for extractors that support authentication (by providing login and password with `--username` and `--password`) in order not to pass credentials as command line arguments on every youtube-dl execution and prevent tracking plain text passwords in the shell command history. You can achieve this using a [`.netrc` file](http://stackoverflow.com/tags/.netrc/info) on per extractor basis. For that you will need to create a`.netrc` file in your `$HOME` and restrict permissions to read/write by you only:
|
You may also want to configure automatic credentials storage for extractors that support authentication (by providing login and password with `--username` and `--password`) in order not to pass credentials as command line arguments on every youtube-dl execution and prevent tracking plain text passwords in the shell command history. You can achieve this using a [`.netrc` file](http://stackoverflow.com/tags/.netrc/info) on per extractor basis. For that you will need to create a `.netrc` file in your `$HOME` and restrict permissions to read/write by you only:
|
||||||
```
|
```
|
||||||
touch $HOME/.netrc
|
touch $HOME/.netrc
|
||||||
chmod a-rwx,u+rw $HOME/.netrc
|
chmod a-rwx,u+rw $HOME/.netrc
|
||||||
@@ -463,7 +474,7 @@ The basic usage is not to set any template arguments when downloading a single f
|
|||||||
- `display_id`: An alternative identifier for the video
|
- `display_id`: An alternative identifier for the video
|
||||||
- `uploader`: Full name of the video uploader
|
- `uploader`: Full name of the video uploader
|
||||||
- `license`: License name the video is licensed under
|
- `license`: License name the video is licensed under
|
||||||
- `creator`: The main artist who created the video
|
- `creator`: The creator of the video
|
||||||
- `release_date`: The date (YYYYMMDD) when the video was released
|
- `release_date`: The date (YYYYMMDD) when the video was released
|
||||||
- `timestamp`: UNIX timestamp of the moment the video became available
|
- `timestamp`: UNIX timestamp of the moment the video became available
|
||||||
- `upload_date`: Video upload date (YYYYMMDD)
|
- `upload_date`: Video upload date (YYYYMMDD)
|
||||||
@@ -500,6 +511,9 @@ The basic usage is not to set any template arguments when downloading a single f
|
|||||||
- `autonumber`: Five-digit number that will be increased with each download, starting at zero
|
- `autonumber`: Five-digit number that will be increased with each download, starting at zero
|
||||||
- `playlist`: Name or id of the playlist that contains the video
|
- `playlist`: Name or id of the playlist that contains the video
|
||||||
- `playlist_index`: Index of the video in the playlist padded with leading zeros according to the total length of the playlist
|
- `playlist_index`: Index of the video in the playlist padded with leading zeros according to the total length of the playlist
|
||||||
|
- `playlist_id`: Playlist identifier
|
||||||
|
- `playlist_title`: Playlist title
|
||||||
|
|
||||||
|
|
||||||
Available for the video that belongs to some logical chapter or section:
|
Available for the video that belongs to some logical chapter or section:
|
||||||
- `chapter`: Name or title of the chapter the video belongs to
|
- `chapter`: Name or title of the chapter the video belongs to
|
||||||
@@ -515,6 +529,18 @@ Available for the video that is an episode of some series or programme:
|
|||||||
- `episode_number`: Number of the video episode within a season
|
- `episode_number`: Number of the video episode within a season
|
||||||
- `episode_id`: Id of the video episode
|
- `episode_id`: Id of the video episode
|
||||||
|
|
||||||
|
Available for the media that is a track or a part of a music album:
|
||||||
|
- `track`: Title of the track
|
||||||
|
- `track_number`: Number of the track within an album or a disc
|
||||||
|
- `track_id`: Id of the track
|
||||||
|
- `artist`: Artist(s) of the track
|
||||||
|
- `genre`: Genre(s) of the track
|
||||||
|
- `album`: Title of the album the track belongs to
|
||||||
|
- `album_type`: Type of the album
|
||||||
|
- `album_artist`: List of all artists appeared on the album
|
||||||
|
- `disc_number`: Number of the disc or other physical medium the track belongs to
|
||||||
|
- `release_year`: Year (YYYY) when the album was released
|
||||||
|
|
||||||
Each aforementioned sequence when referenced in output template will be replaced by the actual value corresponding to the sequence name. Note that some of the sequences are not guaranteed to be present since they depend on the metadata obtained by particular extractor, such sequences will be replaced with `NA`.
|
Each aforementioned sequence when referenced in output template will be replaced by the actual value corresponding to the sequence name. Note that some of the sequences are not guaranteed to be present since they depend on the metadata obtained by particular extractor, such sequences will be replaced with `NA`.
|
||||||
|
|
||||||
For example for `-o %(title)s-%(id)s.%(ext)s` and mp4 video with title `youtube-dl test video` and id `BaW_jenozKcj` this will result in a `youtube-dl test video-BaW_jenozKcj.mp4` file created in the current directory.
|
For example for `-o %(title)s-%(id)s.%(ext)s` and mp4 video with title `youtube-dl test video` and id `BaW_jenozKcj` this will result in a `youtube-dl test video-BaW_jenozKcj.mp4` file created in the current directory.
|
||||||
@@ -527,6 +553,10 @@ The current default template is `%(title)s-%(id)s.%(ext)s`.
|
|||||||
|
|
||||||
In some cases, you don't want special characters such as 中, spaces, or &, such as when transferring the downloaded filename to a Windows system or the filename through an 8bit-unsafe channel. In these cases, add the `--restrict-filenames` flag to get a shorter title:
|
In some cases, you don't want special characters such as 中, spaces, or &, such as when transferring the downloaded filename to a Windows system or the filename through an 8bit-unsafe channel. In these cases, add the `--restrict-filenames` flag to get a shorter title:
|
||||||
|
|
||||||
|
#### Output template and Windows batch files
|
||||||
|
|
||||||
|
If you are using output template inside a Windows batch file then you must escape plain percent characters (`%`) by doubling, so that `-o "%(title)s-%(id)s.%(ext)s"` should become `-o "%%(title)s-%%(id)s.%%(ext)s"`. However you should not touch `%`'s that are not plain characters, e.g. environment variables for expansion should stay intact: `-o "C:\%HOMEPATH%\Desktop\%%(title)s.%%(ext)s"`.
|
||||||
|
|
||||||
#### Output template examples
|
#### Output template examples
|
||||||
|
|
||||||
Note on Windows you may need to use double quotes instead of single.
|
Note on Windows you may need to use double quotes instead of single.
|
||||||
@@ -677,12 +707,20 @@ hash -r
|
|||||||
|
|
||||||
Again, from then on you'll be able to update with `sudo youtube-dl -U`.
|
Again, from then on you'll be able to update with `sudo youtube-dl -U`.
|
||||||
|
|
||||||
|
### youtube-dl is extremely slow to start on Windows
|
||||||
|
|
||||||
|
Add a file exclusion for `youtube-dl.exe` in Windows Defender settings.
|
||||||
|
|
||||||
### I'm getting an error `Unable to extract OpenGraph title` on YouTube playlists
|
### I'm getting an error `Unable to extract OpenGraph title` on YouTube playlists
|
||||||
|
|
||||||
YouTube changed their playlist format in March 2014 and later on, so you'll need at least youtube-dl 2014.07.25 to download all YouTube videos.
|
YouTube changed their playlist format in March 2014 and later on, so you'll need at least youtube-dl 2014.07.25 to download all YouTube videos.
|
||||||
|
|
||||||
If you have installed youtube-dl with a package manager, pip, setup.py or a tarball, please use that to update. Note that Ubuntu packages do not seem to get updated anymore. Since we are not affiliated with Ubuntu, there is little we can do. Feel free to [report bugs](https://bugs.launchpad.net/ubuntu/+source/youtube-dl/+filebug) to the [Ubuntu packaging guys](mailto:ubuntu-motu@lists.ubuntu.com?subject=outdated%20version%20of%20youtube-dl) - all they have to do is update the package to a somewhat recent version. See above for a way to update.
|
If you have installed youtube-dl with a package manager, pip, setup.py or a tarball, please use that to update. Note that Ubuntu packages do not seem to get updated anymore. Since we are not affiliated with Ubuntu, there is little we can do. Feel free to [report bugs](https://bugs.launchpad.net/ubuntu/+source/youtube-dl/+filebug) to the [Ubuntu packaging guys](mailto:ubuntu-motu@lists.ubuntu.com?subject=outdated%20version%20of%20youtube-dl) - all they have to do is update the package to a somewhat recent version. See above for a way to update.
|
||||||
|
|
||||||
|
### I'm getting an error when trying to use output template: `error: using output template conflicts with using title, video ID or auto number`
|
||||||
|
|
||||||
|
Make sure you are not using `-o` with any of these options `-t`, `--title`, `--id`, `-A` or `--auto-number` set in command line or in a configuration file. Remove the latter if any.
|
||||||
|
|
||||||
### Do I always have to pass `-citw`?
|
### Do I always have to pass `-citw`?
|
||||||
|
|
||||||
By default, youtube-dl intends to have the best options (incidentally, if you have a convincing case that these should be different, [please file an issue where you explain that](https://yt-dl.org/bug)). Therefore, it is unnecessary and sometimes harmful to copy long option strings from webpages. In particular, the only option out of `-citw` that is regularly useful is `-i`.
|
By default, youtube-dl intends to have the best options (incidentally, if you have a convincing case that these should be different, [please file an issue where you explain that](https://yt-dl.org/bug)). Therefore, it is unnecessary and sometimes harmful to copy long option strings from webpages. In particular, the only option out of `-citw` that is regularly useful is `-i`.
|
||||||
@@ -703,7 +741,7 @@ Videos or video formats streamed via RTMP protocol can only be downloaded when [
|
|||||||
|
|
||||||
### I have downloaded a video but how can I play it?
|
### I have downloaded a video but how can I play it?
|
||||||
|
|
||||||
Once the video is fully downloaded, use any video player, such as [vlc](http://www.videolan.org) or [mplayer](http://www.mplayerhq.hu/).
|
Once the video is fully downloaded, use any video player, such as [mpv](https://mpv.io/), [vlc](http://www.videolan.org) or [mplayer](http://www.mplayerhq.hu/).
|
||||||
|
|
||||||
### I extracted a video URL with `-g`, but it does not play on another machine / in my webbrowser.
|
### I extracted a video URL with `-g`, but it does not play on another machine / in my webbrowser.
|
||||||
|
|
||||||
@@ -760,9 +798,9 @@ means you're using an outdated version of Python. Please update to Python 2.6 or
|
|||||||
|
|
||||||
Since June 2012 ([#342](https://github.com/rg3/youtube-dl/issues/342)) youtube-dl is packed as an executable zipfile, simply unzip it (might need renaming to `youtube-dl.zip` first on some systems) or clone the git repository, as laid out above. If you modify the code, you can run it by executing the `__main__.py` file. To recompile the executable, run `make youtube-dl`.
|
Since June 2012 ([#342](https://github.com/rg3/youtube-dl/issues/342)) youtube-dl is packed as an executable zipfile, simply unzip it (might need renaming to `youtube-dl.zip` first on some systems) or clone the git repository, as laid out above. If you modify the code, you can run it by executing the `__main__.py` file. To recompile the executable, run `make youtube-dl`.
|
||||||
|
|
||||||
### The exe throws a *Runtime error from Visual C++*
|
### The exe throws an error due to missing `MSVCR100.dll`
|
||||||
|
|
||||||
To run the exe you need to install first the [Microsoft Visual C++ 2008 Redistributable Package](http://www.microsoft.com/en-us/download/details.aspx?id=29).
|
To run the exe you need to install first the [Microsoft Visual C++ 2010 Redistributable Package (x86)](https://www.microsoft.com/en-US/download/details.aspx?id=5555).
|
||||||
|
|
||||||
### On Windows, how should I set up ffmpeg and youtube-dl? Where should I put the exe files?
|
### On Windows, how should I set up ffmpeg and youtube-dl? Where should I put the exe files?
|
||||||
|
|
||||||
@@ -817,6 +855,12 @@ It is *not* possible to detect whether a URL is supported or not. That's because
|
|||||||
|
|
||||||
If you want to find out whether a given URL is supported, simply call youtube-dl with it. If you get no videos back, chances are the URL is either not referring to a video or unsupported. You can find out which by examining the output (if you run youtube-dl on the console) or catching an `UnsupportedError` exception if you run it from a Python program.
|
If you want to find out whether a given URL is supported, simply call youtube-dl with it. If you get no videos back, chances are the URL is either not referring to a video or unsupported. You can find out which by examining the output (if you run youtube-dl on the console) or catching an `UnsupportedError` exception if you run it from a Python program.
|
||||||
|
|
||||||
|
# Why do I need to go through that much red tape when filing bugs?
|
||||||
|
|
||||||
|
Before we had the issue template, despite our extensive [bug reporting instructions](#bugs), about 80% of the issue reports we got were useless, for instance because people used ancient versions hundreds of releases old, because of simple syntactic errors (not in youtube-dl but in general shell usage), because the problem was alrady reported multiple times before, because people did not actually read an error message, even if it said "please install ffmpeg", because people did not mention the URL they were trying to download and many more simple, easy-to-avoid problems, many of whom were totally unrelated to youtube-dl.
|
||||||
|
|
||||||
|
youtube-dl is an open-source project manned by too few volunteers, so we'd rather spend time fixing bugs where we are certain none of those simple problems apply, and where we can be reasonably confident to be able to reproduce the issue without asking the reporter repeatedly. As such, the output of `youtube-dl -v YOUR_URL_HERE` is really all that's required to file an issue. The issue template also guides you through some basic steps you can do, such as checking that your version of youtube-dl is current.
|
||||||
|
|
||||||
# DEVELOPER INSTRUCTIONS
|
# DEVELOPER INSTRUCTIONS
|
||||||
|
|
||||||
Most users do not need to build youtube-dl and can [download the builds](http://rg3.github.io/youtube-dl/download.html) or get them from their distribution.
|
Most users do not need to build youtube-dl and can [download the builds](http://rg3.github.io/youtube-dl/download.html) or get them from their distribution.
|
||||||
@@ -889,14 +933,14 @@ After you have ensured this site is distributing it's content legally, you can f
|
|||||||
# TODO more properties (see youtube_dl/extractor/common.py)
|
# TODO more properties (see youtube_dl/extractor/common.py)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
5. Add an import in [`youtube_dl/extractor/__init__.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/__init__.py).
|
5. Add an import in [`youtube_dl/extractor/extractors.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/extractors.py).
|
||||||
6. Run `python test/test_download.py TestDownload.test_YourExtractor`. This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename ``_TEST`` to ``_TESTS`` and make it into a list of dictionaries. The tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc.
|
6. Run `python test/test_download.py TestDownload.test_YourExtractor`. This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename ``_TEST`` to ``_TESTS`` and make it into a list of dictionaries. The tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc.
|
||||||
7. Have a look at [`youtube_dl/extractor/common.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py) for possible helper methods and a [detailed description of what your extractor should and may return](https://github.com/rg3/youtube-dl/blob/58525c94d547be1c8167d16c298bdd75506db328/youtube_dl/extractor/common.py#L68-L226). Add tests and code for as many as you want.
|
7. Have a look at [`youtube_dl/extractor/common.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py) for possible helper methods and a [detailed description of what your extractor should and may return](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L74-L252). Add tests and code for as many as you want.
|
||||||
8. Keep in mind that the only mandatory fields in info dict for successful extraction process are `id`, `title` and either `url` or `formats`, i.e. these are the critical data the extraction does not make any sense without. This means that [any field](https://github.com/rg3/youtube-dl/blob/58525c94d547be1c8167d16c298bdd75506db328/youtube_dl/extractor/common.py#L138-L226) apart from aforementioned mandatory ones should be treated **as optional** and extraction should be **tolerate** to situations when sources for these fields can potentially be unavailable (even if they always available at the moment) and **future-proof** in order not to break the extraction of general purpose mandatory fields. For example, if you have some intermediate dict `meta` that is a source of metadata and it has a key `summary` that you want to extract and put into resulting info dict as `description`, you should be ready that this key may be missing from the `meta` dict, i.e. you should extract it as `meta.get('summary')` and not `meta['summary']`. Similarly, you should pass `fatal=False` when extracting data from a webpage with `_search_regex/_html_search_regex`.
|
8. Keep in mind that the only mandatory fields in info dict for successful extraction process are `id`, `title` and either `url` or `formats`, i.e. these are the critical data the extraction does not make any sense without. This means that [any field](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L148-L252) apart from aforementioned mandatory ones should be treated **as optional** and extraction should be **tolerate** to situations when sources for these fields can potentially be unavailable (even if they always available at the moment) and **future-proof** in order not to break the extraction of general purpose mandatory fields. For example, if you have some intermediate dict `meta` that is a source of metadata and it has a key `summary` that you want to extract and put into resulting info dict as `description`, you should be ready that this key may be missing from the `meta` dict, i.e. you should extract it as `meta.get('summary')` and not `meta['summary']`. Similarly, you should pass `fatal=False` when extracting data from a webpage with `_search_regex/_html_search_regex`.
|
||||||
9. Check the code with [flake8](https://pypi.python.org/pypi/flake8).
|
9. Check the code with [flake8](https://pypi.python.org/pypi/flake8). Also make sure your code works under all [Python](http://www.python.org/) versions claimed supported by youtube-dl, namely 2.6, 2.7, and 3.2+.
|
||||||
10. When the tests pass, [add](http://git-scm.com/docs/git-add) the new files and [commit](http://git-scm.com/docs/git-commit) them and [push](http://git-scm.com/docs/git-push) the result, like this:
|
10. When the tests pass, [add](http://git-scm.com/docs/git-add) the new files and [commit](http://git-scm.com/docs/git-commit) them and [push](http://git-scm.com/docs/git-push) the result, like this:
|
||||||
|
|
||||||
$ git add youtube_dl/extractor/__init__.py
|
$ git add youtube_dl/extractor/extractors.py
|
||||||
$ git add youtube_dl/extractor/yourextractor.py
|
$ git add youtube_dl/extractor/yourextractor.py
|
||||||
$ git commit -m '[yourextractor] Add new extractor'
|
$ git commit -m '[yourextractor] Add new extractor'
|
||||||
$ git push origin yourextractor
|
$ git push origin yourextractor
|
||||||
@@ -920,7 +964,7 @@ with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
|||||||
ydl.download(['http://www.youtube.com/watch?v=BaW_jenozKc'])
|
ydl.download(['http://www.youtube.com/watch?v=BaW_jenozKc'])
|
||||||
```
|
```
|
||||||
|
|
||||||
Most likely, you'll want to use various options. For a list of what can be done, have a look at [`youtube_dl/YoutubeDL.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L121-L269). For a start, if you want to intercept youtube-dl's output, set a `logger` object.
|
Most likely, you'll want to use various options. For a list of options available, have a look at [`youtube_dl/YoutubeDL.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L128-L278). For a start, if you want to intercept youtube-dl's output, set a `logger` object.
|
||||||
|
|
||||||
Here's a more complete example of a program that outputs only errors (and a short message after the download is finished), and downloads/converts the video to an mp3 file:
|
Here's a more complete example of a program that outputs only errors (and a short message after the download is finished), and downloads/converts the video to an mp3 file:
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,38 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
from http.server import HTTPServer, BaseHTTPRequestHandler
|
|
||||||
from socketserver import ThreadingMixIn
|
|
||||||
import argparse
|
import argparse
|
||||||
import ctypes
|
import ctypes
|
||||||
import functools
|
import functools
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import tempfile
|
||||||
import threading
|
import threading
|
||||||
import traceback
|
import traceback
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
|
sys.path.insert(0, os.path.dirname(os.path.dirname((os.path.abspath(__file__)))))
|
||||||
|
from youtube_dl.compat import (
|
||||||
|
compat_input,
|
||||||
|
compat_http_server,
|
||||||
|
compat_str,
|
||||||
|
compat_urlparse,
|
||||||
|
)
|
||||||
|
|
||||||
class BuildHTTPServer(ThreadingMixIn, HTTPServer):
|
# These are not used outside of buildserver.py thus not in compat.py
|
||||||
|
|
||||||
|
try:
|
||||||
|
import winreg as compat_winreg
|
||||||
|
except ImportError: # Python 2
|
||||||
|
import _winreg as compat_winreg
|
||||||
|
|
||||||
|
try:
|
||||||
|
import socketserver as compat_socketserver
|
||||||
|
except ImportError: # Python 2
|
||||||
|
import SocketServer as compat_socketserver
|
||||||
|
|
||||||
|
|
||||||
|
class BuildHTTPServer(compat_socketserver.ThreadingMixIn, compat_http_server.HTTPServer):
|
||||||
allow_reuse_address = True
|
allow_reuse_address = True
|
||||||
|
|
||||||
|
|
||||||
@@ -191,7 +212,7 @@ def main(args=None):
|
|||||||
action='store_const', dest='action', const='service',
|
action='store_const', dest='action', const='service',
|
||||||
help='Run as a Windows service')
|
help='Run as a Windows service')
|
||||||
parser.add_argument('-b', '--bind', metavar='<host:port>',
|
parser.add_argument('-b', '--bind', metavar='<host:port>',
|
||||||
action='store', default='localhost:8142',
|
action='store', default='0.0.0.0:8142',
|
||||||
help='Bind to host:port (default %default)')
|
help='Bind to host:port (default %default)')
|
||||||
options = parser.parse_args(args=args)
|
options = parser.parse_args(args=args)
|
||||||
|
|
||||||
@@ -216,7 +237,7 @@ def main(args=None):
|
|||||||
srv = BuildHTTPServer((host, port), BuildHTTPRequestHandler)
|
srv = BuildHTTPServer((host, port), BuildHTTPRequestHandler)
|
||||||
thr = threading.Thread(target=srv.serve_forever)
|
thr = threading.Thread(target=srv.serve_forever)
|
||||||
thr.start()
|
thr.start()
|
||||||
input('Press ENTER to shut down')
|
compat_input('Press ENTER to shut down')
|
||||||
srv.shutdown()
|
srv.shutdown()
|
||||||
thr.join()
|
thr.join()
|
||||||
|
|
||||||
@@ -231,8 +252,6 @@ def rmtree(path):
|
|||||||
os.remove(fname)
|
os.remove(fname)
|
||||||
os.rmdir(path)
|
os.rmdir(path)
|
||||||
|
|
||||||
#==============================================================================
|
|
||||||
|
|
||||||
|
|
||||||
class BuildError(Exception):
|
class BuildError(Exception):
|
||||||
def __init__(self, output, code=500):
|
def __init__(self, output, code=500):
|
||||||
@@ -249,15 +268,25 @@ class HTTPError(BuildError):
|
|||||||
|
|
||||||
class PythonBuilder(object):
|
class PythonBuilder(object):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
pythonVersion = kwargs.pop('python', '2.7')
|
python_version = kwargs.pop('python', '3.4')
|
||||||
try:
|
python_path = None
|
||||||
key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Python\PythonCore\%s\InstallPath' % pythonVersion)
|
for node in ('Wow6432Node\\', ''):
|
||||||
try:
|
try:
|
||||||
self.pythonPath, _ = _winreg.QueryValueEx(key, '')
|
key = compat_winreg.OpenKey(
|
||||||
finally:
|
compat_winreg.HKEY_LOCAL_MACHINE,
|
||||||
_winreg.CloseKey(key)
|
r'SOFTWARE\%sPython\PythonCore\%s\InstallPath' % (node, python_version))
|
||||||
except Exception:
|
try:
|
||||||
raise BuildError('No such Python version: %s' % pythonVersion)
|
python_path, _ = compat_winreg.QueryValueEx(key, '')
|
||||||
|
finally:
|
||||||
|
compat_winreg.CloseKey(key)
|
||||||
|
break
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if not python_path:
|
||||||
|
raise BuildError('No such Python version: %s' % python_version)
|
||||||
|
|
||||||
|
self.pythonPath = python_path
|
||||||
|
|
||||||
super(PythonBuilder, self).__init__(**kwargs)
|
super(PythonBuilder, self).__init__(**kwargs)
|
||||||
|
|
||||||
@@ -305,8 +334,10 @@ class YoutubeDLBuilder(object):
|
|||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
try:
|
try:
|
||||||
subprocess.check_output([os.path.join(self.pythonPath, 'python.exe'), 'setup.py', 'py2exe'],
|
proc = subprocess.Popen([os.path.join(self.pythonPath, 'python.exe'), 'setup.py', 'py2exe'], stdin=subprocess.PIPE, cwd=self.buildPath)
|
||||||
cwd=self.buildPath)
|
proc.wait()
|
||||||
|
#subprocess.check_output([os.path.join(self.pythonPath, 'python.exe'), 'setup.py', 'py2exe'],
|
||||||
|
# cwd=self.buildPath)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
raise BuildError(e.output)
|
raise BuildError(e.output)
|
||||||
|
|
||||||
@@ -369,12 +400,12 @@ class Builder(PythonBuilder, GITBuilder, YoutubeDLBuilder, DownloadBuilder, Clea
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class BuildHTTPRequestHandler(BaseHTTPRequestHandler):
|
class BuildHTTPRequestHandler(compat_http_server.BaseHTTPRequestHandler):
|
||||||
actionDict = {'build': Builder, 'download': Builder} # They're the same, no more caching.
|
actionDict = {'build': Builder, 'download': Builder} # They're the same, no more caching.
|
||||||
|
|
||||||
def do_GET(self):
|
def do_GET(self):
|
||||||
path = urlparse.urlparse(self.path)
|
path = compat_urlparse.urlparse(self.path)
|
||||||
paramDict = dict([(key, value[0]) for key, value in urlparse.parse_qs(path.query).items()])
|
paramDict = dict([(key, value[0]) for key, value in compat_urlparse.parse_qs(path.query).items()])
|
||||||
action, _, path = path.path.strip('/').partition('/')
|
action, _, path = path.path.strip('/').partition('/')
|
||||||
if path:
|
if path:
|
||||||
path = path.split('/')
|
path = path.split('/')
|
||||||
@@ -388,7 +419,7 @@ class BuildHTTPRequestHandler(BaseHTTPRequestHandler):
|
|||||||
builder.close()
|
builder.close()
|
||||||
except BuildError as e:
|
except BuildError as e:
|
||||||
self.send_response(e.code)
|
self.send_response(e.code)
|
||||||
msg = unicode(e).encode('UTF-8')
|
msg = compat_str(e).encode('UTF-8')
|
||||||
self.send_header('Content-Type', 'text/plain; charset=UTF-8')
|
self.send_header('Content-Type', 'text/plain; charset=UTF-8')
|
||||||
self.send_header('Content-Length', len(msg))
|
self.send_header('Content-Length', len(msg))
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
@@ -400,7 +431,5 @@ class BuildHTTPRequestHandler(BaseHTTPRequestHandler):
|
|||||||
else:
|
else:
|
||||||
self.send_response(500, 'Malformed URL')
|
self.send_response(500, 'Malformed URL')
|
||||||
|
|
||||||
#==============================================================================
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
111
devscripts/create-github-release.py
Normal file
111
devscripts/create-github-release.py
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import base64
|
||||||
|
import json
|
||||||
|
import mimetypes
|
||||||
|
import netrc
|
||||||
|
import optparse
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
|
from youtube_dl.compat import (
|
||||||
|
compat_basestring,
|
||||||
|
compat_input,
|
||||||
|
compat_getpass,
|
||||||
|
compat_print,
|
||||||
|
compat_urllib_request,
|
||||||
|
)
|
||||||
|
from youtube_dl.utils import (
|
||||||
|
make_HTTPS_handler,
|
||||||
|
sanitized_Request,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class GitHubReleaser(object):
|
||||||
|
_API_URL = 'https://api.github.com/repos/rg3/youtube-dl/releases'
|
||||||
|
_UPLOADS_URL = 'https://uploads.github.com/repos/rg3/youtube-dl/releases/%s/assets?name=%s'
|
||||||
|
_NETRC_MACHINE = 'github.com'
|
||||||
|
|
||||||
|
def __init__(self, debuglevel=0):
|
||||||
|
self._init_github_account()
|
||||||
|
https_handler = make_HTTPS_handler({}, debuglevel=debuglevel)
|
||||||
|
self._opener = compat_urllib_request.build_opener(https_handler)
|
||||||
|
|
||||||
|
def _init_github_account(self):
|
||||||
|
try:
|
||||||
|
info = netrc.netrc().authenticators(self._NETRC_MACHINE)
|
||||||
|
if info is not None:
|
||||||
|
self._username = info[0]
|
||||||
|
self._password = info[2]
|
||||||
|
compat_print('Using GitHub credentials found in .netrc...')
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
compat_print('No GitHub credentials found in .netrc')
|
||||||
|
except (IOError, netrc.NetrcParseError):
|
||||||
|
compat_print('Unable to parse .netrc')
|
||||||
|
self._username = compat_input(
|
||||||
|
'Type your GitHub username or email address and press [Return]: ')
|
||||||
|
self._password = compat_getpass(
|
||||||
|
'Type your GitHub password and press [Return]: ')
|
||||||
|
|
||||||
|
def _call(self, req):
|
||||||
|
if isinstance(req, compat_basestring):
|
||||||
|
req = sanitized_Request(req)
|
||||||
|
# Authorizing manually since GitHub does not response with 401 with
|
||||||
|
# WWW-Authenticate header set (see
|
||||||
|
# https://developer.github.com/v3/#basic-authentication)
|
||||||
|
b64 = base64.b64encode(
|
||||||
|
('%s:%s' % (self._username, self._password)).encode('utf-8')).decode('ascii')
|
||||||
|
req.add_header('Authorization', 'Basic %s' % b64)
|
||||||
|
response = self._opener.open(req).read().decode('utf-8')
|
||||||
|
return json.loads(response)
|
||||||
|
|
||||||
|
def list_releases(self):
|
||||||
|
return self._call(self._API_URL)
|
||||||
|
|
||||||
|
def create_release(self, tag_name, name=None, body='', draft=False, prerelease=False):
|
||||||
|
data = {
|
||||||
|
'tag_name': tag_name,
|
||||||
|
'target_commitish': 'master',
|
||||||
|
'name': name,
|
||||||
|
'body': body,
|
||||||
|
'draft': draft,
|
||||||
|
'prerelease': prerelease,
|
||||||
|
}
|
||||||
|
req = sanitized_Request(self._API_URL, json.dumps(data).encode('utf-8'))
|
||||||
|
return self._call(req)
|
||||||
|
|
||||||
|
def create_asset(self, release_id, asset):
|
||||||
|
asset_name = os.path.basename(asset)
|
||||||
|
url = self._UPLOADS_URL % (release_id, asset_name)
|
||||||
|
# Our files are small enough to be loaded directly into memory.
|
||||||
|
data = open(asset, 'rb').read()
|
||||||
|
req = sanitized_Request(url, data)
|
||||||
|
mime_type, _ = mimetypes.guess_type(asset_name)
|
||||||
|
req.add_header('Content-Type', mime_type or 'application/octet-stream')
|
||||||
|
return self._call(req)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = optparse.OptionParser(usage='%prog VERSION BUILDPATH')
|
||||||
|
options, args = parser.parse_args()
|
||||||
|
if len(args) != 2:
|
||||||
|
parser.error('Expected a version and a build directory')
|
||||||
|
|
||||||
|
version, build_path = args
|
||||||
|
|
||||||
|
releaser = GitHubReleaser()
|
||||||
|
|
||||||
|
new_release = releaser.create_release(version, name='youtube-dl %s' % version)
|
||||||
|
release_id = new_release['id']
|
||||||
|
|
||||||
|
for asset in os.listdir(build_path):
|
||||||
|
compat_print('Uploading %s...' % asset)
|
||||||
|
releaser.create_asset(release_id, os.path.join(build_path, asset))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
8
devscripts/install_srelay.sh
Executable file
8
devscripts/install_srelay.sh
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mkdir -p tmp && cd tmp
|
||||||
|
wget -N http://downloads.sourceforge.net/project/socks-relay/socks-relay/srelay-0.4.8/srelay-0.4.8b6.tar.gz
|
||||||
|
tar zxvf srelay-0.4.8b6.tar.gz
|
||||||
|
cd srelay-0.4.8b6
|
||||||
|
./configure
|
||||||
|
make
|
||||||
19
devscripts/lazy_load_template.py
Normal file
19
devscripts/lazy_load_template.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# encoding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
class LazyLoadExtractor(object):
|
||||||
|
_module = None
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def ie_key(cls):
|
||||||
|
return cls.__name__[:-2]
|
||||||
|
|
||||||
|
def __new__(cls, *args, **kwargs):
|
||||||
|
mod = __import__(cls._module, fromlist=(cls.__name__,))
|
||||||
|
real_cls = getattr(mod, cls.__name__)
|
||||||
|
instance = real_cls.__new__(real_cls)
|
||||||
|
instance.__init__(*args, **kwargs)
|
||||||
|
return instance
|
||||||
98
devscripts/make_lazy_extractors.py
Normal file
98
devscripts/make_lazy_extractors.py
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
from __future__ import unicode_literals, print_function
|
||||||
|
|
||||||
|
from inspect import getsource
|
||||||
|
import os
|
||||||
|
from os.path import dirname as dirn
|
||||||
|
import sys
|
||||||
|
|
||||||
|
print('WARNING: Lazy loading extractors is an experimental feature that may not always work', file=sys.stderr)
|
||||||
|
|
||||||
|
sys.path.insert(0, dirn(dirn((os.path.abspath(__file__)))))
|
||||||
|
|
||||||
|
lazy_extractors_filename = sys.argv[1]
|
||||||
|
if os.path.exists(lazy_extractors_filename):
|
||||||
|
os.remove(lazy_extractors_filename)
|
||||||
|
|
||||||
|
from youtube_dl.extractor import _ALL_CLASSES
|
||||||
|
from youtube_dl.extractor.common import InfoExtractor, SearchInfoExtractor
|
||||||
|
|
||||||
|
with open('devscripts/lazy_load_template.py', 'rt') as f:
|
||||||
|
module_template = f.read()
|
||||||
|
|
||||||
|
module_contents = [
|
||||||
|
module_template + '\n' + getsource(InfoExtractor.suitable) + '\n',
|
||||||
|
'class LazyLoadSearchExtractor(LazyLoadExtractor):\n pass\n']
|
||||||
|
|
||||||
|
ie_template = '''
|
||||||
|
class {name}({bases}):
|
||||||
|
_VALID_URL = {valid_url!r}
|
||||||
|
_module = '{module}'
|
||||||
|
'''
|
||||||
|
|
||||||
|
make_valid_template = '''
|
||||||
|
@classmethod
|
||||||
|
def _make_valid_url(cls):
|
||||||
|
return {valid_url!r}
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
def get_base_name(base):
|
||||||
|
if base is InfoExtractor:
|
||||||
|
return 'LazyLoadExtractor'
|
||||||
|
elif base is SearchInfoExtractor:
|
||||||
|
return 'LazyLoadSearchExtractor'
|
||||||
|
else:
|
||||||
|
return base.__name__
|
||||||
|
|
||||||
|
|
||||||
|
def build_lazy_ie(ie, name):
|
||||||
|
valid_url = getattr(ie, '_VALID_URL', None)
|
||||||
|
s = ie_template.format(
|
||||||
|
name=name,
|
||||||
|
bases=', '.join(map(get_base_name, ie.__bases__)),
|
||||||
|
valid_url=valid_url,
|
||||||
|
module=ie.__module__)
|
||||||
|
if ie.suitable.__func__ is not InfoExtractor.suitable.__func__:
|
||||||
|
s += '\n' + getsource(ie.suitable)
|
||||||
|
if hasattr(ie, '_make_valid_url'):
|
||||||
|
# search extractors
|
||||||
|
s += make_valid_template.format(valid_url=ie._make_valid_url())
|
||||||
|
return s
|
||||||
|
|
||||||
|
# find the correct sorting and add the required base classes so that sublcasses
|
||||||
|
# can be correctly created
|
||||||
|
classes = _ALL_CLASSES[:-1]
|
||||||
|
ordered_cls = []
|
||||||
|
while classes:
|
||||||
|
for c in classes[:]:
|
||||||
|
bases = set(c.__bases__) - set((object, InfoExtractor, SearchInfoExtractor))
|
||||||
|
stop = False
|
||||||
|
for b in bases:
|
||||||
|
if b not in classes and b not in ordered_cls:
|
||||||
|
if b.__name__ == 'GenericIE':
|
||||||
|
exit()
|
||||||
|
classes.insert(0, b)
|
||||||
|
stop = True
|
||||||
|
if stop:
|
||||||
|
break
|
||||||
|
if all(b in ordered_cls for b in bases):
|
||||||
|
ordered_cls.append(c)
|
||||||
|
classes.remove(c)
|
||||||
|
break
|
||||||
|
ordered_cls.append(_ALL_CLASSES[-1])
|
||||||
|
|
||||||
|
names = []
|
||||||
|
for ie in ordered_cls:
|
||||||
|
name = ie.__name__
|
||||||
|
src = build_lazy_ie(ie, name)
|
||||||
|
module_contents.append(src)
|
||||||
|
if ie in _ALL_CLASSES:
|
||||||
|
names.append(name)
|
||||||
|
|
||||||
|
module_contents.append(
|
||||||
|
'_ALL_CLASSES = [{0}]'.format(', '.join(names)))
|
||||||
|
|
||||||
|
module_src = '\n'.join(module_contents) + '\n'
|
||||||
|
|
||||||
|
with open(lazy_extractors_filename, 'wt') as f:
|
||||||
|
f.write(module_src)
|
||||||
@@ -1,13 +1,46 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import io
|
import io
|
||||||
|
import optparse
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
README_FILE = os.path.join(ROOT_DIR, 'README.md')
|
README_FILE = os.path.join(ROOT_DIR, 'README.md')
|
||||||
|
|
||||||
|
PREFIX = '''%YOUTUBE-DL(1)
|
||||||
|
|
||||||
|
# NAME
|
||||||
|
|
||||||
|
youtube\-dl \- download videos from youtube.com or other video platforms
|
||||||
|
|
||||||
|
# SYNOPSIS
|
||||||
|
|
||||||
|
**youtube-dl** \[OPTIONS\] URL [URL...]
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = optparse.OptionParser(usage='%prog OUTFILE.md')
|
||||||
|
options, args = parser.parse_args()
|
||||||
|
if len(args) != 1:
|
||||||
|
parser.error('Expected an output filename')
|
||||||
|
|
||||||
|
outfile, = args
|
||||||
|
|
||||||
|
with io.open(README_FILE, encoding='utf-8') as f:
|
||||||
|
readme = f.read()
|
||||||
|
|
||||||
|
readme = re.sub(r'(?s)^.*?(?=# DESCRIPTION)', '', readme)
|
||||||
|
readme = re.sub(r'\s+youtube-dl \[OPTIONS\] URL \[URL\.\.\.\]', '', readme)
|
||||||
|
readme = PREFIX + readme
|
||||||
|
|
||||||
|
readme = filter_options(readme)
|
||||||
|
|
||||||
|
with io.open(outfile, 'w', encoding='utf-8') as outf:
|
||||||
|
outf.write(readme)
|
||||||
|
|
||||||
|
|
||||||
def filter_options(readme):
|
def filter_options(readme):
|
||||||
ret = ''
|
ret = ''
|
||||||
@@ -37,27 +70,5 @@ def filter_options(readme):
|
|||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
with io.open(README_FILE, encoding='utf-8') as f:
|
if __name__ == '__main__':
|
||||||
readme = f.read()
|
main()
|
||||||
|
|
||||||
PREFIX = '''%YOUTUBE-DL(1)
|
|
||||||
|
|
||||||
# NAME
|
|
||||||
|
|
||||||
youtube\-dl \- download videos from youtube.com or other video platforms
|
|
||||||
|
|
||||||
# SYNOPSIS
|
|
||||||
|
|
||||||
**youtube-dl** \[OPTIONS\] URL [URL...]
|
|
||||||
|
|
||||||
'''
|
|
||||||
readme = re.sub(r'(?s)^.*?(?=# DESCRIPTION)', '', readme)
|
|
||||||
readme = re.sub(r'\s+youtube-dl \[OPTIONS\] URL \[URL\.\.\.\]', '', readme)
|
|
||||||
readme = PREFIX + readme
|
|
||||||
|
|
||||||
readme = filter_options(readme)
|
|
||||||
|
|
||||||
if sys.version_info < (3, 0):
|
|
||||||
print(readme.encode('utf-8'))
|
|
||||||
else:
|
|
||||||
print(readme)
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
# * the git config user.signingkey is properly set
|
# * the git config user.signingkey is properly set
|
||||||
|
|
||||||
# You will need
|
# You will need
|
||||||
# pip install coverage nose rsa
|
# pip install coverage nose rsa wheel
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
# release notes
|
# release notes
|
||||||
@@ -15,10 +15,33 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
skip_tests=true
|
skip_tests=true
|
||||||
if [ "$1" = '--run-tests' ]; then
|
gpg_sign_commits=""
|
||||||
skip_tests=false
|
buildserver='localhost:8142'
|
||||||
shift
|
|
||||||
fi
|
while true
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
--run-tests)
|
||||||
|
skip_tests=false
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--gpg-sign-commits|-S)
|
||||||
|
gpg_sign_commits="-S"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--buildserver)
|
||||||
|
buildserver="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--*)
|
||||||
|
echo "ERROR: unknown option $1"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
if [ -z "$1" ]; then echo "ERROR: specify version number like this: $0 1994.09.06"; exit 1; fi
|
if [ -z "$1" ]; then echo "ERROR: specify version number like this: $0 1994.09.06"; exit 1; fi
|
||||||
version="$1"
|
version="$1"
|
||||||
@@ -33,6 +56,9 @@ if [ ! -z "`git status --porcelain | grep -v CHANGELOG`" ]; then echo 'ERROR: th
|
|||||||
useless_files=$(find youtube_dl -type f -not -name '*.py')
|
useless_files=$(find youtube_dl -type f -not -name '*.py')
|
||||||
if [ ! -z "$useless_files" ]; then echo "ERROR: Non-.py files in youtube_dl: $useless_files"; exit 1; fi
|
if [ ! -z "$useless_files" ]; then echo "ERROR: Non-.py files in youtube_dl: $useless_files"; exit 1; fi
|
||||||
if [ ! -f "updates_key.pem" ]; then echo 'ERROR: updates_key.pem missing'; exit 1; fi
|
if [ ! -f "updates_key.pem" ]; then echo 'ERROR: updates_key.pem missing'; exit 1; fi
|
||||||
|
if ! type pandoc >/dev/null 2>/dev/null; then echo 'ERROR: pandoc is missing'; exit 1; fi
|
||||||
|
if ! python3 -c 'import rsa' 2>/dev/null; then echo 'ERROR: python3-rsa is missing'; exit 1; fi
|
||||||
|
if ! python3 -c 'import wheel' 2>/dev/null; then echo 'ERROR: wheel is missing'; exit 1; fi
|
||||||
|
|
||||||
/bin/echo -e "\n### First of all, testing..."
|
/bin/echo -e "\n### First of all, testing..."
|
||||||
make clean
|
make clean
|
||||||
@@ -48,7 +74,7 @@ sed -i "s/__version__ = '.*'/__version__ = '$version'/" youtube_dl/version.py
|
|||||||
/bin/echo -e "\n### Committing documentation, templates and youtube_dl/version.py..."
|
/bin/echo -e "\n### Committing documentation, templates and youtube_dl/version.py..."
|
||||||
make README.md CONTRIBUTING.md .github/ISSUE_TEMPLATE.md supportedsites
|
make README.md CONTRIBUTING.md .github/ISSUE_TEMPLATE.md supportedsites
|
||||||
git add README.md CONTRIBUTING.md .github/ISSUE_TEMPLATE.md docs/supportedsites.md youtube_dl/version.py
|
git add README.md CONTRIBUTING.md .github/ISSUE_TEMPLATE.md docs/supportedsites.md youtube_dl/version.py
|
||||||
git commit -m "release $version"
|
git commit $gpg_sign_commits -m "release $version"
|
||||||
|
|
||||||
/bin/echo -e "\n### Now tagging, signing and pushing..."
|
/bin/echo -e "\n### Now tagging, signing and pushing..."
|
||||||
git tag -s -m "Release $version" "$version"
|
git tag -s -m "Release $version" "$version"
|
||||||
@@ -64,7 +90,7 @@ git push origin "$version"
|
|||||||
REV=$(git rev-parse HEAD)
|
REV=$(git rev-parse HEAD)
|
||||||
make youtube-dl youtube-dl.tar.gz
|
make youtube-dl youtube-dl.tar.gz
|
||||||
read -p "VM running? (y/n) " -n 1
|
read -p "VM running? (y/n) " -n 1
|
||||||
wget "http://localhost:8142/build/rg3/youtube-dl/youtube-dl.exe?rev=$REV" -O youtube-dl.exe
|
wget "http://$buildserver/build/rg3/youtube-dl/youtube-dl.exe?rev=$REV" -O youtube-dl.exe
|
||||||
mkdir -p "build/$version"
|
mkdir -p "build/$version"
|
||||||
mv youtube-dl youtube-dl.exe "build/$version"
|
mv youtube-dl youtube-dl.exe "build/$version"
|
||||||
mv youtube-dl.tar.gz "build/$version/youtube-dl-$version.tar.gz"
|
mv youtube-dl.tar.gz "build/$version/youtube-dl-$version.tar.gz"
|
||||||
@@ -74,15 +100,16 @@ RELEASE_FILES="youtube-dl youtube-dl.exe youtube-dl-$version.tar.gz"
|
|||||||
(cd build/$version/ && sha256sum $RELEASE_FILES > SHA2-256SUMS)
|
(cd build/$version/ && sha256sum $RELEASE_FILES > SHA2-256SUMS)
|
||||||
(cd build/$version/ && sha512sum $RELEASE_FILES > SHA2-512SUMS)
|
(cd build/$version/ && sha512sum $RELEASE_FILES > SHA2-512SUMS)
|
||||||
|
|
||||||
/bin/echo -e "\n### Signing and uploading the new binaries to yt-dl.org ..."
|
/bin/echo -e "\n### Signing and uploading the new binaries to GitHub..."
|
||||||
for f in $RELEASE_FILES; do gpg --passphrase-repeat 5 --detach-sig "build/$version/$f"; done
|
for f in $RELEASE_FILES; do gpg --passphrase-repeat 5 --detach-sig "build/$version/$f"; done
|
||||||
scp -r "build/$version" ytdl@yt-dl.org:html/tmp/
|
|
||||||
ssh ytdl@yt-dl.org "mv html/tmp/$version html/downloads/"
|
ROOT=$(pwd)
|
||||||
|
python devscripts/create-github-release.py $version "$ROOT/build/$version"
|
||||||
|
|
||||||
ssh ytdl@yt-dl.org "sh html/update_latest.sh $version"
|
ssh ytdl@yt-dl.org "sh html/update_latest.sh $version"
|
||||||
|
|
||||||
/bin/echo -e "\n### Now switching to gh-pages..."
|
/bin/echo -e "\n### Now switching to gh-pages..."
|
||||||
git clone --branch gh-pages --single-branch . build/gh-pages
|
git clone --branch gh-pages --single-branch . build/gh-pages
|
||||||
ROOT=$(pwd)
|
|
||||||
(
|
(
|
||||||
set -e
|
set -e
|
||||||
ORIGIN_URL=$(git config --get remote.origin.url)
|
ORIGIN_URL=$(git config --get remote.origin.url)
|
||||||
@@ -94,7 +121,7 @@ ROOT=$(pwd)
|
|||||||
"$ROOT/devscripts/gh-pages/update-copyright.py"
|
"$ROOT/devscripts/gh-pages/update-copyright.py"
|
||||||
"$ROOT/devscripts/gh-pages/update-sites.py"
|
"$ROOT/devscripts/gh-pages/update-sites.py"
|
||||||
git add *.html *.html.in update
|
git add *.html *.html.in update
|
||||||
git commit -m "release $version"
|
git commit $gpg_sign_commits -m "release $version"
|
||||||
git push "$ROOT" gh-pages
|
git push "$ROOT" gh-pages
|
||||||
git push "$ORIGIN_URL" gh-pages
|
git push "$ORIGIN_URL" gh-pages
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
- **22tracks:genre**
|
- **22tracks:genre**
|
||||||
- **22tracks:track**
|
- **22tracks:track**
|
||||||
- **24video**
|
- **24video**
|
||||||
|
- **3qsdn**: 3Q SDN
|
||||||
- **3sat**
|
- **3sat**
|
||||||
- **4tube**
|
- **4tube**
|
||||||
- **56.com**
|
- **56.com**
|
||||||
@@ -15,6 +16,8 @@
|
|||||||
- **9gag**
|
- **9gag**
|
||||||
- **abc.net.au**
|
- **abc.net.au**
|
||||||
- **Abc7News**
|
- **Abc7News**
|
||||||
|
- **abcnews**
|
||||||
|
- **abcnews:video**
|
||||||
- **AcademicEarth:Course**
|
- **AcademicEarth:Course**
|
||||||
- **acast**
|
- **acast**
|
||||||
- **acast:channel**
|
- **acast:channel**
|
||||||
@@ -25,6 +28,7 @@
|
|||||||
- **AdobeTVVideo**
|
- **AdobeTVVideo**
|
||||||
- **AdultSwim**
|
- **AdultSwim**
|
||||||
- **aenetworks**: A+E Networks: A&E, Lifetime, History.com, FYI Network
|
- **aenetworks**: A+E Networks: A&E, Lifetime, History.com, FYI Network
|
||||||
|
- **AfreecaTV**: afreecatv.com
|
||||||
- **Aftonbladet**
|
- **Aftonbladet**
|
||||||
- **AirMozilla**
|
- **AirMozilla**
|
||||||
- **AlJazeera**
|
- **AlJazeera**
|
||||||
@@ -40,7 +44,6 @@
|
|||||||
- **appletrailers:section**
|
- **appletrailers:section**
|
||||||
- **archive.org**: archive.org videos
|
- **archive.org**: archive.org videos
|
||||||
- **ARD**
|
- **ARD**
|
||||||
- **ARD:mediathek**: Saarländischer Rundfunk
|
|
||||||
- **ARD:mediathek**
|
- **ARD:mediathek**
|
||||||
- **arte.tv**
|
- **arte.tv**
|
||||||
- **arte.tv:+7**
|
- **arte.tv:+7**
|
||||||
@@ -50,7 +53,9 @@
|
|||||||
- **arte.tv:ddc**
|
- **arte.tv:ddc**
|
||||||
- **arte.tv:embed**
|
- **arte.tv:embed**
|
||||||
- **arte.tv:future**
|
- **arte.tv:future**
|
||||||
|
- **arte.tv:info**
|
||||||
- **arte.tv:magazine**
|
- **arte.tv:magazine**
|
||||||
|
- **arte.tv:playlist**
|
||||||
- **AtresPlayer**
|
- **AtresPlayer**
|
||||||
- **ATTTechChannel**
|
- **ATTTechChannel**
|
||||||
- **AudiMedia**
|
- **AudiMedia**
|
||||||
@@ -68,6 +73,8 @@
|
|||||||
- **bbc**: BBC
|
- **bbc**: BBC
|
||||||
- **bbc.co.uk**: BBC iPlayer
|
- **bbc.co.uk**: BBC iPlayer
|
||||||
- **bbc.co.uk:article**: BBC articles
|
- **bbc.co.uk:article**: BBC articles
|
||||||
|
- **bbc.co.uk:iplayer:playlist**
|
||||||
|
- **bbc.co.uk:playlist**
|
||||||
- **BeatportPro**
|
- **BeatportPro**
|
||||||
- **Beeg**
|
- **Beeg**
|
||||||
- **BehindKink**
|
- **BehindKink**
|
||||||
@@ -76,6 +83,7 @@
|
|||||||
- **Bild**: Bild.de
|
- **Bild**: Bild.de
|
||||||
- **BiliBili**
|
- **BiliBili**
|
||||||
- **BioBioChileTV**
|
- **BioBioChileTV**
|
||||||
|
- **BIQLE**
|
||||||
- **BleacherReport**
|
- **BleacherReport**
|
||||||
- **BleacherReportCMS**
|
- **BleacherReportCMS**
|
||||||
- **blinkx**
|
- **blinkx**
|
||||||
@@ -97,10 +105,13 @@
|
|||||||
- **canalc2.tv**
|
- **canalc2.tv**
|
||||||
- **Canalplus**: canalplus.fr, piwiplus.fr and d8.tv
|
- **Canalplus**: canalplus.fr, piwiplus.fr and d8.tv
|
||||||
- **Canvas**
|
- **Canvas**
|
||||||
|
- **CarambaTV**
|
||||||
|
- **CarambaTVPage**
|
||||||
- **CBC**
|
- **CBC**
|
||||||
- **CBCPlayer**
|
- **CBCPlayer**
|
||||||
- **CBS**
|
- **CBS**
|
||||||
- **CBSInteractive**
|
- **CBSInteractive**
|
||||||
|
- **CBSLocal**
|
||||||
- **CBSNews**: CBS News
|
- **CBSNews**: CBS News
|
||||||
- **CBSNewsLiveVideo**: CBS News Live Videos
|
- **CBSNewsLiveVideo**: CBS News Live Videos
|
||||||
- **CBSSports**
|
- **CBSSports**
|
||||||
@@ -112,10 +123,11 @@
|
|||||||
- **chirbit**
|
- **chirbit**
|
||||||
- **chirbit:profile**
|
- **chirbit:profile**
|
||||||
- **Cinchcast**
|
- **Cinchcast**
|
||||||
- **Cinemassacre**
|
|
||||||
- **Clipfish**
|
- **Clipfish**
|
||||||
- **cliphunter**
|
- **cliphunter**
|
||||||
|
- **ClipRs**
|
||||||
- **Clipsyndicate**
|
- **Clipsyndicate**
|
||||||
|
- **CloserToTruth**
|
||||||
- **cloudtime**: CloudTime
|
- **cloudtime**: CloudTime
|
||||||
- **Cloudy**
|
- **Cloudy**
|
||||||
- **Clubic**
|
- **Clubic**
|
||||||
@@ -125,12 +137,12 @@
|
|||||||
- **CNN**
|
- **CNN**
|
||||||
- **CNNArticle**
|
- **CNNArticle**
|
||||||
- **CNNBlogs**
|
- **CNNBlogs**
|
||||||
- **CollegeHumor**
|
|
||||||
- **CollegeRama**
|
- **CollegeRama**
|
||||||
- **ComCarCoff**
|
- **ComCarCoff**
|
||||||
- **ComedyCentral**
|
- **ComedyCentral**
|
||||||
- **ComedyCentralShows**: The Daily Show / The Colbert Report
|
- **ComedyCentralShows**: The Daily Show / The Colbert Report
|
||||||
- **CondeNast**: Condé Nast media group: Allure, Architectural Digest, Ars Technica, Bon Appétit, Brides, Condé Nast, Condé Nast Traveler, Details, Epicurious, GQ, Glamour, Golf Digest, SELF, Teen Vogue, The New Yorker, Vanity Fair, Vogue, W Magazine, WIRED
|
- **CondeNast**: Condé Nast media group: Allure, Architectural Digest, Ars Technica, Bon Appétit, Brides, Condé Nast, Condé Nast Traveler, Details, Epicurious, GQ, Glamour, Golf Digest, SELF, Teen Vogue, The New Yorker, Vanity Fair, Vogue, W Magazine, WIRED
|
||||||
|
- **Coub**
|
||||||
- **Cracked**
|
- **Cracked**
|
||||||
- **Crackle**
|
- **Crackle**
|
||||||
- **Criterion**
|
- **Criterion**
|
||||||
@@ -140,9 +152,12 @@
|
|||||||
- **CSNNE**
|
- **CSNNE**
|
||||||
- **CSpan**: C-SPAN
|
- **CSpan**: C-SPAN
|
||||||
- **CtsNews**: 華視新聞
|
- **CtsNews**: 華視新聞
|
||||||
|
- **CTV**
|
||||||
|
- **CTVNews**
|
||||||
- **culturebox.francetvinfo.fr**
|
- **culturebox.francetvinfo.fr**
|
||||||
- **CultureUnplugged**
|
- **CultureUnplugged**
|
||||||
- **CWTV**
|
- **CWTV**
|
||||||
|
- **DailyMail**
|
||||||
- **dailymotion**
|
- **dailymotion**
|
||||||
- **dailymotion:playlist**
|
- **dailymotion:playlist**
|
||||||
- **dailymotion:user**
|
- **dailymotion:user**
|
||||||
@@ -161,6 +176,7 @@
|
|||||||
- **defense.gouv.fr**
|
- **defense.gouv.fr**
|
||||||
- **democracynow**
|
- **democracynow**
|
||||||
- **DHM**: Filmarchiv - Deutsches Historisches Museum
|
- **DHM**: Filmarchiv - Deutsches Historisches Museum
|
||||||
|
- **DigitallySpeaking**
|
||||||
- **Digiteka**
|
- **Digiteka**
|
||||||
- **Discovery**
|
- **Discovery**
|
||||||
- **Dotsub**
|
- **Dotsub**
|
||||||
@@ -172,7 +188,6 @@
|
|||||||
- **Dropbox**
|
- **Dropbox**
|
||||||
- **DrTuber**
|
- **DrTuber**
|
||||||
- **DRTV**
|
- **DRTV**
|
||||||
- **Dump**
|
|
||||||
- **Dumpert**
|
- **Dumpert**
|
||||||
- **dvtv**: http://video.aktualne.cz/
|
- **dvtv**: http://video.aktualne.cz/
|
||||||
- **dw**
|
- **dw**
|
||||||
@@ -199,6 +214,7 @@
|
|||||||
- **exfm**: ex.fm
|
- **exfm**: ex.fm
|
||||||
- **ExpoTV**
|
- **ExpoTV**
|
||||||
- **ExtremeTube**
|
- **ExtremeTube**
|
||||||
|
- **EyedoTV**
|
||||||
- **facebook**
|
- **facebook**
|
||||||
- **faz.net**
|
- **faz.net**
|
||||||
- **fc2**
|
- **fc2**
|
||||||
@@ -210,6 +226,7 @@
|
|||||||
- **Flickr**
|
- **Flickr**
|
||||||
- **Folketinget**: Folketinget (ft.dk; Danish parliament)
|
- **Folketinget**: Folketinget (ft.dk; Danish parliament)
|
||||||
- **FootyRoom**
|
- **FootyRoom**
|
||||||
|
- **Formula1**
|
||||||
- **FOX**
|
- **FOX**
|
||||||
- **Foxgay**
|
- **Foxgay**
|
||||||
- **FoxNews**: Fox News and Fox Business Video
|
- **FoxNews**: Fox News and Fox Business Video
|
||||||
@@ -225,6 +242,7 @@
|
|||||||
- **FreeVideo**
|
- **FreeVideo**
|
||||||
- **Funimation**
|
- **Funimation**
|
||||||
- **FunnyOrDie**
|
- **FunnyOrDie**
|
||||||
|
- **Fusion**
|
||||||
- **GameInformer**
|
- **GameInformer**
|
||||||
- **Gamekings**
|
- **Gamekings**
|
||||||
- **GameOne**
|
- **GameOne**
|
||||||
@@ -232,7 +250,6 @@
|
|||||||
- **Gamersyde**
|
- **Gamersyde**
|
||||||
- **GameSpot**
|
- **GameSpot**
|
||||||
- **GameStar**
|
- **GameStar**
|
||||||
- **Gametrailers**
|
|
||||||
- **Gazeta**
|
- **Gazeta**
|
||||||
- **GDCVault**
|
- **GDCVault**
|
||||||
- **generic**: Generic downloader that works on some sites
|
- **generic**: Generic downloader that works on some sites
|
||||||
@@ -243,6 +260,7 @@
|
|||||||
- **Globo**
|
- **Globo**
|
||||||
- **GloboArticle**
|
- **GloboArticle**
|
||||||
- **GodTube**
|
- **GodTube**
|
||||||
|
- **GodTV**
|
||||||
- **GoldenMoustache**
|
- **GoldenMoustache**
|
||||||
- **Golem**
|
- **Golem**
|
||||||
- **GoogleDrive**
|
- **GoogleDrive**
|
||||||
@@ -257,6 +275,7 @@
|
|||||||
- **Helsinki**: helsinki.fi
|
- **Helsinki**: helsinki.fi
|
||||||
- **HentaiStigma**
|
- **HentaiStigma**
|
||||||
- **HistoricFilms**
|
- **HistoricFilms**
|
||||||
|
- **history:topic**: History.com Topic
|
||||||
- **hitbox**
|
- **hitbox**
|
||||||
- **hitbox:live**
|
- **hitbox:live**
|
||||||
- **HornBunny**
|
- **HornBunny**
|
||||||
@@ -264,6 +283,8 @@
|
|||||||
- **HotStar**
|
- **HotStar**
|
||||||
- **Howcast**
|
- **Howcast**
|
||||||
- **HowStuffWorks**
|
- **HowStuffWorks**
|
||||||
|
- **HRTi**
|
||||||
|
- **HRTiPlaylist**
|
||||||
- **HuffPost**: Huffington Post
|
- **HuffPost**: Huffington Post
|
||||||
- **Hypem**
|
- **Hypem**
|
||||||
- **Iconosquare**
|
- **Iconosquare**
|
||||||
@@ -286,7 +307,6 @@
|
|||||||
- **ivi:compilation**: ivi.ru compilations
|
- **ivi:compilation**: ivi.ru compilations
|
||||||
- **ivideon**: Ivideon TV
|
- **ivideon**: Ivideon TV
|
||||||
- **Izlesene**
|
- **Izlesene**
|
||||||
- **JadoreCettePub**
|
|
||||||
- **JeuxVideo**
|
- **JeuxVideo**
|
||||||
- **Jove**
|
- **Jove**
|
||||||
- **jpopsuki.tv**
|
- **jpopsuki.tv**
|
||||||
@@ -311,23 +331,27 @@
|
|||||||
- **kuwo:mv**: 酷我音乐 - MV
|
- **kuwo:mv**: 酷我音乐 - MV
|
||||||
- **kuwo:singer**: 酷我音乐 - 歌手
|
- **kuwo:singer**: 酷我音乐 - 歌手
|
||||||
- **kuwo:song**: 酷我音乐
|
- **kuwo:song**: 酷我音乐
|
||||||
- **la7.tv**
|
- **la7.it**
|
||||||
- **Laola1Tv**
|
- **Laola1Tv**
|
||||||
- **Le**: 乐视网
|
- **Le**: 乐视网
|
||||||
|
- **Learnr**
|
||||||
- **Lecture2Go**
|
- **Lecture2Go**
|
||||||
- **Lemonde**
|
- **Lemonde**
|
||||||
- **LePlaylist**
|
- **LePlaylist**
|
||||||
- **LetvCloud**: 乐视云
|
- **LetvCloud**: 乐视云
|
||||||
- **Libsyn**
|
- **Libsyn**
|
||||||
|
- **life**: Life.ru
|
||||||
- **life:embed**
|
- **life:embed**
|
||||||
- **lifenews**: LIFE | NEWS
|
|
||||||
- **limelight**
|
- **limelight**
|
||||||
- **limelight:channel**
|
- **limelight:channel**
|
||||||
- **limelight:channel_list**
|
- **limelight:channel_list**
|
||||||
|
- **LiTV**
|
||||||
- **LiveLeak**
|
- **LiveLeak**
|
||||||
- **livestream**
|
- **livestream**
|
||||||
- **livestream:original**
|
- **livestream:original**
|
||||||
- **LnkGo**
|
- **LnkGo**
|
||||||
|
- **loc**: Library of Congress
|
||||||
|
- **LocalNews8**
|
||||||
- **LoveHomePorn**
|
- **LoveHomePorn**
|
||||||
- **lrt.lt**
|
- **lrt.lt**
|
||||||
- **lynda**: lynda.com videos
|
- **lynda**: lynda.com videos
|
||||||
@@ -337,26 +361,29 @@
|
|||||||
- **mailru**: Видео@Mail.Ru
|
- **mailru**: Видео@Mail.Ru
|
||||||
- **MakersChannel**
|
- **MakersChannel**
|
||||||
- **MakerTV**
|
- **MakerTV**
|
||||||
- **Malemotion**
|
|
||||||
- **MatchTV**
|
- **MatchTV**
|
||||||
- **MDR**: MDR.DE and KiKA
|
- **MDR**: MDR.DE and KiKA
|
||||||
- **media.ccc.de**
|
- **media.ccc.de**
|
||||||
|
- **META**
|
||||||
- **metacafe**
|
- **metacafe**
|
||||||
- **Metacritic**
|
- **Metacritic**
|
||||||
- **Mgoon**
|
- **Mgoon**
|
||||||
|
- **MGTV**: 芒果TV
|
||||||
- **Minhateca**
|
- **Minhateca**
|
||||||
- **MinistryGrid**
|
- **MinistryGrid**
|
||||||
- **Minoto**
|
- **Minoto**
|
||||||
- **miomio.tv**
|
- **miomio.tv**
|
||||||
- **MiTele**: mitele.es
|
- **MiTele**: mitele.es
|
||||||
- **mixcloud**
|
- **mixcloud**
|
||||||
|
- **mixcloud:playlist**
|
||||||
|
- **mixcloud:stream**
|
||||||
|
- **mixcloud:user**
|
||||||
- **MLB**
|
- **MLB**
|
||||||
- **Mnet**
|
- **Mnet**
|
||||||
- **MoeVideo**: LetitBit video services: moevideo.net, playreplay.net and videochart.net
|
- **MoeVideo**: LetitBit video services: moevideo.net, playreplay.net and videochart.net
|
||||||
- **Mofosex**
|
- **Mofosex**
|
||||||
- **Mojvideo**
|
- **Mojvideo**
|
||||||
- **Moniker**: allmyvideos.net and vidspot.net
|
- **Moniker**: allmyvideos.net and vidspot.net
|
||||||
- **mooshare**: Mooshare.biz
|
|
||||||
- **Morningstar**: morningstar.com
|
- **Morningstar**: morningstar.com
|
||||||
- **Motherless**
|
- **Motherless**
|
||||||
- **Motorsport**: motorsport.com
|
- **Motorsport**: motorsport.com
|
||||||
@@ -364,15 +391,17 @@
|
|||||||
- **MovieFap**
|
- **MovieFap**
|
||||||
- **Moviezine**
|
- **Moviezine**
|
||||||
- **MPORA**
|
- **MPORA**
|
||||||
- **MSNBC**
|
- **MSN**
|
||||||
- **MTV**
|
- **MTV**
|
||||||
- **mtv.de**
|
- **mtv.de**
|
||||||
- **mtviggy.com**
|
- **mtviggy.com**
|
||||||
- **mtvservices:embedded**
|
- **mtvservices:embedded**
|
||||||
- **MuenchenTV**: münchen.tv
|
- **MuenchenTV**: münchen.tv
|
||||||
- **MusicPlayOn**
|
- **MusicPlayOn**
|
||||||
- **muzu.tv**
|
- **mva**: Microsoft Virtual Academy videos
|
||||||
|
- **mva:course**: Microsoft Virtual Academy courses
|
||||||
- **Mwave**
|
- **Mwave**
|
||||||
|
- **MwaveMeetGreet**
|
||||||
- **MySpace**
|
- **MySpace**
|
||||||
- **MySpace:album**
|
- **MySpace:album**
|
||||||
- **MySpass**
|
- **MySpass**
|
||||||
@@ -393,7 +422,6 @@
|
|||||||
- **ndr:embed:base**
|
- **ndr:embed:base**
|
||||||
- **NDTV**
|
- **NDTV**
|
||||||
- **NerdCubedFeed**
|
- **NerdCubedFeed**
|
||||||
- **Nerdist**
|
|
||||||
- **netease:album**: 网易云音乐 - 专辑
|
- **netease:album**: 网易云音乐 - 专辑
|
||||||
- **netease:djradio**: 网易云音乐 - 电台
|
- **netease:djradio**: 网易云音乐 - 电台
|
||||||
- **netease:mv**: 网易云音乐 - MV
|
- **netease:mv**: 网易云音乐 - MV
|
||||||
@@ -411,10 +439,13 @@
|
|||||||
- **nfl.com**
|
- **nfl.com**
|
||||||
- **nhl.com**
|
- **nhl.com**
|
||||||
- **nhl.com:news**: NHL news
|
- **nhl.com:news**: NHL news
|
||||||
- **nhl.com:videocenter**: NHL videocenter category
|
- **nhl.com:videocenter**
|
||||||
|
- **nhl.com:videocenter:category**: NHL videocenter category
|
||||||
- **nick.com**
|
- **nick.com**
|
||||||
|
- **nick.de**
|
||||||
- **niconico**: ニコニコ動画
|
- **niconico**: ニコニコ動画
|
||||||
- **NiconicoPlaylist**
|
- **NiconicoPlaylist**
|
||||||
|
- **NineCNineMedia**
|
||||||
- **njoy**: N-JOY
|
- **njoy**: N-JOY
|
||||||
- **njoy:embed**
|
- **njoy:embed**
|
||||||
- **Noco**
|
- **Noco**
|
||||||
@@ -459,13 +490,14 @@
|
|||||||
- **Patreon**
|
- **Patreon**
|
||||||
- **pbs**: Public Broadcasting Service (PBS) and member stations: PBS: Public Broadcasting Service, APT - Alabama Public Television (WBIQ), GPB/Georgia Public Broadcasting (WGTV), Mississippi Public Broadcasting (WMPN), Nashville Public Television (WNPT), WFSU-TV (WFSU), WSRE (WSRE), WTCI (WTCI), WPBA/Channel 30 (WPBA), Alaska Public Media (KAKM), Arizona PBS (KAET), KNME-TV/Channel 5 (KNME), Vegas PBS (KLVX), AETN/ARKANSAS ETV NETWORK (KETS), KET (WKLE), WKNO/Channel 10 (WKNO), LPB/LOUISIANA PUBLIC BROADCASTING (WLPB), OETA (KETA), Ozarks Public Television (KOZK), WSIU Public Broadcasting (WSIU), KEET TV (KEET), KIXE/Channel 9 (KIXE), KPBS San Diego (KPBS), KQED (KQED), KVIE Public Television (KVIE), PBS SoCal/KOCE (KOCE), ValleyPBS (KVPT), CONNECTICUT PUBLIC TELEVISION (WEDH), KNPB Channel 5 (KNPB), SOPTV (KSYS), Rocky Mountain PBS (KRMA), KENW-TV3 (KENW), KUED Channel 7 (KUED), Wyoming PBS (KCWC), Colorado Public Television / KBDI 12 (KBDI), KBYU-TV (KBYU), Thirteen/WNET New York (WNET), WGBH/Channel 2 (WGBH), WGBY (WGBY), NJTV Public Media NJ (WNJT), WLIW21 (WLIW), mpt/Maryland Public Television (WMPB), WETA Television and Radio (WETA), WHYY (WHYY), PBS 39 (WLVT), WVPT - Your Source for PBS and More! (WVPT), Howard University Television (WHUT), WEDU PBS (WEDU), WGCU Public Media (WGCU), WPBT2 (WPBT), WUCF TV (WUCF), WUFT/Channel 5 (WUFT), WXEL/Channel 42 (WXEL), WLRN/Channel 17 (WLRN), WUSF Public Broadcasting (WUSF), ETV (WRLK), UNC-TV (WUNC), PBS Hawaii - Oceanic Cable Channel 10 (KHET), Idaho Public Television (KAID), KSPS (KSPS), OPB (KOPB), KWSU/Channel 10 & KTNW/Channel 31 (KWSU), WILL-TV (WILL), Network Knowledge - WSEC/Springfield (WSEC), WTTW11 (WTTW), Iowa Public Television/IPTV (KDIN), Nine Network (KETC), PBS39 Fort Wayne (WFWA), WFYI Indianapolis (WFYI), Milwaukee Public Television (WMVS), WNIN (WNIN), WNIT Public Television (WNIT), WPT (WPNE), WVUT/Channel 22 (WVUT), WEIU/Channel 51 (WEIU), WQPT-TV (WQPT), WYCC PBS Chicago (WYCC), WIPB-TV (WIPB), WTIU (WTIU), CET (WCET), ThinkTVNetwork (WPTD), WBGU-TV (WBGU), WGVU TV (WGVU), NET1 (KUON), Pioneer Public Television (KWCM), SDPB Television (KUSD), TPT (KTCA), KSMQ (KSMQ), KPTS/Channel 8 (KPTS), KTWU/Channel 11 (KTWU), East Tennessee PBS (WSJK), WCTE-TV (WCTE), WLJT, Channel 11 (WLJT), WOSU TV (WOSU), WOUB/WOUC (WOUB), WVPB (WVPB), WKYU-PBS (WKYU), KERA 13 (KERA), MPBN (WCBB), Mountain Lake PBS (WCFE), NHPTV (WENH), Vermont PBS (WETK), witf (WITF), WQED Multimedia (WQED), WMHT Educational Telecommunications (WMHT), Q-TV (WDCQ), WTVS Detroit Public TV (WTVS), CMU Public Television (WCMU), WKAR-TV (WKAR), WNMU-TV Public TV 13 (WNMU), WDSE - WRPT (WDSE), WGTE TV (WGTE), Lakeland Public Television (KAWE), KMOS-TV - Channels 6.1, 6.2 and 6.3 (KMOS), MontanaPBS (KUSM), KRWG/Channel 22 (KRWG), KACV (KACV), KCOS/Channel 13 (KCOS), WCNY/Channel 24 (WCNY), WNED (WNED), WPBS (WPBS), WSKG Public TV (WSKG), WXXI (WXXI), WPSU (WPSU), WVIA Public Media Studios (WVIA), WTVI (WTVI), Western Reserve PBS (WNEO), WVIZ/PBS ideastream (WVIZ), KCTS 9 (KCTS), Basin PBS (KPBT), KUHT / Channel 8 (KUHT), KLRN (KLRN), KLRU (KLRU), WTJX Channel 12 (WTJX), WCVE PBS (WCVE), KBTC Public Television (KBTC)
|
- **pbs**: Public Broadcasting Service (PBS) and member stations: PBS: Public Broadcasting Service, APT - Alabama Public Television (WBIQ), GPB/Georgia Public Broadcasting (WGTV), Mississippi Public Broadcasting (WMPN), Nashville Public Television (WNPT), WFSU-TV (WFSU), WSRE (WSRE), WTCI (WTCI), WPBA/Channel 30 (WPBA), Alaska Public Media (KAKM), Arizona PBS (KAET), KNME-TV/Channel 5 (KNME), Vegas PBS (KLVX), AETN/ARKANSAS ETV NETWORK (KETS), KET (WKLE), WKNO/Channel 10 (WKNO), LPB/LOUISIANA PUBLIC BROADCASTING (WLPB), OETA (KETA), Ozarks Public Television (KOZK), WSIU Public Broadcasting (WSIU), KEET TV (KEET), KIXE/Channel 9 (KIXE), KPBS San Diego (KPBS), KQED (KQED), KVIE Public Television (KVIE), PBS SoCal/KOCE (KOCE), ValleyPBS (KVPT), CONNECTICUT PUBLIC TELEVISION (WEDH), KNPB Channel 5 (KNPB), SOPTV (KSYS), Rocky Mountain PBS (KRMA), KENW-TV3 (KENW), KUED Channel 7 (KUED), Wyoming PBS (KCWC), Colorado Public Television / KBDI 12 (KBDI), KBYU-TV (KBYU), Thirteen/WNET New York (WNET), WGBH/Channel 2 (WGBH), WGBY (WGBY), NJTV Public Media NJ (WNJT), WLIW21 (WLIW), mpt/Maryland Public Television (WMPB), WETA Television and Radio (WETA), WHYY (WHYY), PBS 39 (WLVT), WVPT - Your Source for PBS and More! (WVPT), Howard University Television (WHUT), WEDU PBS (WEDU), WGCU Public Media (WGCU), WPBT2 (WPBT), WUCF TV (WUCF), WUFT/Channel 5 (WUFT), WXEL/Channel 42 (WXEL), WLRN/Channel 17 (WLRN), WUSF Public Broadcasting (WUSF), ETV (WRLK), UNC-TV (WUNC), PBS Hawaii - Oceanic Cable Channel 10 (KHET), Idaho Public Television (KAID), KSPS (KSPS), OPB (KOPB), KWSU/Channel 10 & KTNW/Channel 31 (KWSU), WILL-TV (WILL), Network Knowledge - WSEC/Springfield (WSEC), WTTW11 (WTTW), Iowa Public Television/IPTV (KDIN), Nine Network (KETC), PBS39 Fort Wayne (WFWA), WFYI Indianapolis (WFYI), Milwaukee Public Television (WMVS), WNIN (WNIN), WNIT Public Television (WNIT), WPT (WPNE), WVUT/Channel 22 (WVUT), WEIU/Channel 51 (WEIU), WQPT-TV (WQPT), WYCC PBS Chicago (WYCC), WIPB-TV (WIPB), WTIU (WTIU), CET (WCET), ThinkTVNetwork (WPTD), WBGU-TV (WBGU), WGVU TV (WGVU), NET1 (KUON), Pioneer Public Television (KWCM), SDPB Television (KUSD), TPT (KTCA), KSMQ (KSMQ), KPTS/Channel 8 (KPTS), KTWU/Channel 11 (KTWU), East Tennessee PBS (WSJK), WCTE-TV (WCTE), WLJT, Channel 11 (WLJT), WOSU TV (WOSU), WOUB/WOUC (WOUB), WVPB (WVPB), WKYU-PBS (WKYU), KERA 13 (KERA), MPBN (WCBB), Mountain Lake PBS (WCFE), NHPTV (WENH), Vermont PBS (WETK), witf (WITF), WQED Multimedia (WQED), WMHT Educational Telecommunications (WMHT), Q-TV (WDCQ), WTVS Detroit Public TV (WTVS), CMU Public Television (WCMU), WKAR-TV (WKAR), WNMU-TV Public TV 13 (WNMU), WDSE - WRPT (WDSE), WGTE TV (WGTE), Lakeland Public Television (KAWE), KMOS-TV - Channels 6.1, 6.2 and 6.3 (KMOS), MontanaPBS (KUSM), KRWG/Channel 22 (KRWG), KACV (KACV), KCOS/Channel 13 (KCOS), WCNY/Channel 24 (WCNY), WNED (WNED), WPBS (WPBS), WSKG Public TV (WSKG), WXXI (WXXI), WPSU (WPSU), WVIA Public Media Studios (WVIA), WTVI (WTVI), Western Reserve PBS (WNEO), WVIZ/PBS ideastream (WVIZ), KCTS 9 (KCTS), Basin PBS (KPBT), KUHT / Channel 8 (KUHT), KLRN (KLRN), KLRU (KLRU), WTJX Channel 12 (WTJX), WCVE PBS (WCVE), KBTC Public Television (KBTC)
|
||||||
- **pcmag**
|
- **pcmag**
|
||||||
- **Periscope**: Periscope
|
- **People**
|
||||||
|
- **periscope**: Periscope
|
||||||
|
- **periscope:user**: Periscope user videos
|
||||||
- **PhilharmonieDeParis**: Philharmonie de Paris
|
- **PhilharmonieDeParis**: Philharmonie de Paris
|
||||||
- **phoenix.de**
|
- **phoenix.de**
|
||||||
- **Photobucket**
|
- **Photobucket**
|
||||||
- **Pinkbike**
|
- **Pinkbike**
|
||||||
- **Pladform**
|
- **Pladform**
|
||||||
- **PlanetaPlay**
|
|
||||||
- **play.fm**
|
- **play.fm**
|
||||||
- **played.to**
|
- **played.to**
|
||||||
- **PlaysTV**
|
- **PlaysTV**
|
||||||
@@ -477,13 +509,15 @@
|
|||||||
- **plus.google**: Google Plus
|
- **plus.google**: Google Plus
|
||||||
- **pluzz.francetv.fr**
|
- **pluzz.francetv.fr**
|
||||||
- **podomatic**
|
- **podomatic**
|
||||||
|
- **PolskieRadio**
|
||||||
- **PornHd**
|
- **PornHd**
|
||||||
- **PornHub**
|
- **PornHub**: PornHub and Thumbzilla
|
||||||
- **PornHubPlaylist**
|
- **PornHubPlaylist**
|
||||||
- **PornHubUserVideos**
|
- **PornHubUserVideos**
|
||||||
- **Pornotube**
|
- **Pornotube**
|
||||||
- **PornoVoisines**
|
- **PornoVoisines**
|
||||||
- **PornoXO**
|
- **PornoXO**
|
||||||
|
- **PressTV**
|
||||||
- **PrimeShareTV**
|
- **PrimeShareTV**
|
||||||
- **PromptFile**
|
- **PromptFile**
|
||||||
- **prosiebensat1**: ProSiebenSat.1 Digital
|
- **prosiebensat1**: ProSiebenSat.1 Digital
|
||||||
@@ -494,10 +528,12 @@
|
|||||||
- **qqmusic:playlist**: QQ音乐 - 歌单
|
- **qqmusic:playlist**: QQ音乐 - 歌单
|
||||||
- **qqmusic:singer**: QQ音乐 - 歌手
|
- **qqmusic:singer**: QQ音乐 - 歌手
|
||||||
- **qqmusic:toplist**: QQ音乐 - 排行榜
|
- **qqmusic:toplist**: QQ音乐 - 排行榜
|
||||||
- **QuickVid**
|
|
||||||
- **R7**
|
- **R7**
|
||||||
|
- **R7Article**
|
||||||
- **radio.de**
|
- **radio.de**
|
||||||
- **radiobremen**
|
- **radiobremen**
|
||||||
|
- **radiocanada**
|
||||||
|
- **RadioCanadaAudioVideo**
|
||||||
- **radiofrance**
|
- **radiofrance**
|
||||||
- **RadioJavan**
|
- **RadioJavan**
|
||||||
- **Rai**
|
- **Rai**
|
||||||
@@ -507,10 +543,13 @@
|
|||||||
- **RedTube**
|
- **RedTube**
|
||||||
- **RegioTV**
|
- **RegioTV**
|
||||||
- **Restudy**
|
- **Restudy**
|
||||||
|
- **Reuters**
|
||||||
- **ReverbNation**
|
- **ReverbNation**
|
||||||
- **Revision3**
|
- **revision**
|
||||||
|
- **revision3:embed**
|
||||||
- **RICE**
|
- **RICE**
|
||||||
- **RingTV**
|
- **RingTV**
|
||||||
|
- **RockstarGames**
|
||||||
- **RottenTomatoes**
|
- **RottenTomatoes**
|
||||||
- **Roxwel**
|
- **Roxwel**
|
||||||
- **RTBF**
|
- **RTBF**
|
||||||
@@ -547,24 +586,25 @@
|
|||||||
- **ScreencastOMatic**
|
- **ScreencastOMatic**
|
||||||
- **ScreenJunkies**
|
- **ScreenJunkies**
|
||||||
- **ScreenwaveMedia**
|
- **ScreenwaveMedia**
|
||||||
|
- **Seeker**
|
||||||
- **SenateISVP**
|
- **SenateISVP**
|
||||||
|
- **SendtoNews**
|
||||||
- **ServingSys**
|
- **ServingSys**
|
||||||
- **Sexu**
|
- **Sexu**
|
||||||
- **SexyKarma**: Sexy Karma and Watch Indian Porn
|
|
||||||
- **Shahid**
|
- **Shahid**
|
||||||
- **Shared**: shared.sx and vivo.sx
|
- **Shared**: shared.sx and vivo.sx
|
||||||
- **ShareSix**
|
- **ShareSix**
|
||||||
- **Sina**
|
- **Sina**
|
||||||
|
- **SixPlay**
|
||||||
|
- **skynewsarabia:article**
|
||||||
- **skynewsarabia:video**
|
- **skynewsarabia:video**
|
||||||
- **skynewsarabia:video**
|
- **SkySports**
|
||||||
- **Slideshare**
|
- **Slideshare**
|
||||||
- **Slutload**
|
- **Slutload**
|
||||||
- **smotri**: Smotri.com
|
- **smotri**: Smotri.com
|
||||||
- **smotri:broadcast**: Smotri.com broadcasts
|
- **smotri:broadcast**: Smotri.com broadcasts
|
||||||
- **smotri:community**: Smotri.com community videos
|
- **smotri:community**: Smotri.com community videos
|
||||||
- **smotri:user**: Smotri.com user videos
|
- **smotri:user**: Smotri.com user videos
|
||||||
- **SnagFilms**
|
|
||||||
- **SnagFilmsEmbed**
|
|
||||||
- **Snotr**
|
- **Snotr**
|
||||||
- **Sohu**
|
- **Sohu**
|
||||||
- **soundcloud**
|
- **soundcloud**
|
||||||
@@ -590,6 +630,7 @@
|
|||||||
- **SportBoxEmbed**
|
- **SportBoxEmbed**
|
||||||
- **SportDeutschland**
|
- **SportDeutschland**
|
||||||
- **Sportschau**
|
- **Sportschau**
|
||||||
|
- **sr:mediathek**: Saarländischer Rundfunk
|
||||||
- **SRGSSR**
|
- **SRGSSR**
|
||||||
- **SRGSSRPlay**: srf.ch, rts.ch, rsi.ch, rtr.ch and swissinfo.ch play sites
|
- **SRGSSRPlay**: srf.ch, rts.ch, rsi.ch, rtr.ch and swissinfo.ch play sites
|
||||||
- **SSA**
|
- **SSA**
|
||||||
@@ -606,8 +647,10 @@
|
|||||||
- **Syfy**
|
- **Syfy**
|
||||||
- **SztvHu**
|
- **SztvHu**
|
||||||
- **Tagesschau**
|
- **Tagesschau**
|
||||||
|
- **tagesschau:player**
|
||||||
- **Tapely**
|
- **Tapely**
|
||||||
- **Tass**
|
- **Tass**
|
||||||
|
- **TDSLifeway**
|
||||||
- **teachertube**: teachertube.com videos
|
- **teachertube**: teachertube.com videos
|
||||||
- **teachertube:user:collection**: teachertube.com user and collection videos
|
- **teachertube:user:collection**: teachertube.com user and collection videos
|
||||||
- **TeachingChannel**
|
- **TeachingChannel**
|
||||||
@@ -622,9 +665,9 @@
|
|||||||
- **Telegraaf**
|
- **Telegraaf**
|
||||||
- **TeleMB**
|
- **TeleMB**
|
||||||
- **TeleTask**
|
- **TeleTask**
|
||||||
|
- **Telewebion**
|
||||||
- **TF1**
|
- **TF1**
|
||||||
- **TheIntercept**
|
- **TheIntercept**
|
||||||
- **TheOnion**
|
|
||||||
- **ThePlatform**
|
- **ThePlatform**
|
||||||
- **ThePlatformFeed**
|
- **ThePlatformFeed**
|
||||||
- **TheScene**
|
- **TheScene**
|
||||||
@@ -669,12 +712,12 @@
|
|||||||
- **TVCArticle**
|
- **TVCArticle**
|
||||||
- **tvigle**: Интернет-телевидение Tvigle.ru
|
- **tvigle**: Интернет-телевидение Tvigle.ru
|
||||||
- **tvland.com**
|
- **tvland.com**
|
||||||
- **tvp.pl**
|
- **tvp**: Telewizja Polska
|
||||||
- **tvp.pl:Series**
|
- **tvp:series**
|
||||||
- **TVPlay**: TV3Play and related services
|
- **TVPlay**: TV3Play and related services
|
||||||
- **Tweakers**
|
- **Tweakers**
|
||||||
- **twitch:bookmarks**
|
|
||||||
- **twitch:chapter**
|
- **twitch:chapter**
|
||||||
|
- **twitch:clips**
|
||||||
- **twitch:past_broadcasts**
|
- **twitch:past_broadcasts**
|
||||||
- **twitch:profile**
|
- **twitch:profile**
|
||||||
- **twitch:stream**
|
- **twitch:stream**
|
||||||
@@ -683,16 +726,17 @@
|
|||||||
- **twitter**
|
- **twitter**
|
||||||
- **twitter:amplify**
|
- **twitter:amplify**
|
||||||
- **twitter:card**
|
- **twitter:card**
|
||||||
- **Ubu**
|
|
||||||
- **udemy**
|
- **udemy**
|
||||||
- **udemy:course**
|
- **udemy:course**
|
||||||
- **UDNEmbed**: 聯合影音
|
- **UDNEmbed**: 聯合影音
|
||||||
- **Unistra**
|
- **Unistra**
|
||||||
- **Urort**: NRK P3 Urørt
|
- **Urort**: NRK P3 Urørt
|
||||||
|
- **URPlay**
|
||||||
- **USAToday**
|
- **USAToday**
|
||||||
- **ustream**
|
- **ustream**
|
||||||
- **ustream:channel**
|
- **ustream:channel**
|
||||||
- **Ustudio**
|
- **ustudio**
|
||||||
|
- **ustudio:embed**
|
||||||
- **Varzesh3**
|
- **Varzesh3**
|
||||||
- **Vbox7**
|
- **Vbox7**
|
||||||
- **VeeHD**
|
- **VeeHD**
|
||||||
@@ -700,10 +744,12 @@
|
|||||||
- **Vessel**
|
- **Vessel**
|
||||||
- **Vesti**: Вести.Ru
|
- **Vesti**: Вести.Ru
|
||||||
- **Vevo**
|
- **Vevo**
|
||||||
|
- **VevoPlaylist**
|
||||||
- **VGTV**: VGTV, BTTV, FTV, Aftenposten and Aftonbladet
|
- **VGTV**: VGTV, BTTV, FTV, Aftenposten and Aftonbladet
|
||||||
- **vh1.com**
|
- **vh1.com**
|
||||||
- **Vice**
|
- **Vice**
|
||||||
- **ViceShow**
|
- **ViceShow**
|
||||||
|
- **Vidbit**
|
||||||
- **Viddler**
|
- **Viddler**
|
||||||
- **video.google:search**: Google Video search
|
- **video.google:search**: Google Video search
|
||||||
- **video.mit.edu**
|
- **video.mit.edu**
|
||||||
@@ -716,12 +762,15 @@
|
|||||||
- **VideoPremium**
|
- **VideoPremium**
|
||||||
- **VideoTt**: video.tt - Your True Tube (Currently broken)
|
- **VideoTt**: video.tt - Your True Tube (Currently broken)
|
||||||
- **videoweed**: VideoWeed
|
- **videoweed**: VideoWeed
|
||||||
|
- **Vidio**
|
||||||
- **vidme**
|
- **vidme**
|
||||||
- **vidme:user**
|
- **vidme:user**
|
||||||
- **vidme:user:likes**
|
- **vidme:user:likes**
|
||||||
- **Vidzi**
|
- **Vidzi**
|
||||||
- **vier**
|
- **vier**
|
||||||
- **vier:videos**
|
- **vier:videos**
|
||||||
|
- **ViewLift**
|
||||||
|
- **ViewLiftEmbed**
|
||||||
- **Viewster**
|
- **Viewster**
|
||||||
- **Viidea**
|
- **Viidea**
|
||||||
- **viki**
|
- **viki**
|
||||||
@@ -749,17 +798,15 @@
|
|||||||
- **VRT**
|
- **VRT**
|
||||||
- **vube**: Vube.com
|
- **vube**: Vube.com
|
||||||
- **VuClip**
|
- **VuClip**
|
||||||
- **vulture.com**
|
|
||||||
- **Walla**
|
- **Walla**
|
||||||
- **WashingtonPost**
|
- **washingtonpost**
|
||||||
|
- **washingtonpost:article**
|
||||||
- **wat.tv**
|
- **wat.tv**
|
||||||
- **WayOfTheMaster**
|
- **WatchIndianPorn**: Watch Indian Porn
|
||||||
- **WDR**
|
- **WDR**
|
||||||
- **wdr:mobile**
|
- **wdr:mobile**
|
||||||
- **WDRMaus**: Sendung mit der Maus
|
|
||||||
- **WebOfStories**
|
- **WebOfStories**
|
||||||
- **WebOfStoriesPlaylist**
|
- **WebOfStoriesPlaylist**
|
||||||
- **Weibo**
|
|
||||||
- **WeiqiTV**: WQTV
|
- **WeiqiTV**: WQTV
|
||||||
- **wholecloud**: WholeCloud
|
- **wholecloud**: WholeCloud
|
||||||
- **Wimp**
|
- **Wimp**
|
||||||
@@ -767,12 +814,17 @@
|
|||||||
- **WNL**
|
- **WNL**
|
||||||
- **WorldStarHipHop**
|
- **WorldStarHipHop**
|
||||||
- **wrzuta.pl**
|
- **wrzuta.pl**
|
||||||
|
- **wrzuta.pl:playlist**
|
||||||
- **WSJ**: Wall Street Journal
|
- **WSJ**: Wall Street Journal
|
||||||
- **XBef**
|
- **XBef**
|
||||||
- **XboxClips**
|
- **XboxClips**
|
||||||
- **XFileShare**: XFileShare based sites: GorillaVid.in, daclips.in, movpod.in, fastvideo.in, realvid.net, filehoot.com and vidto.me
|
- **XFileShare**: XFileShare based sites: DaClips, FileHoot, GorillaVid, MovPod, PowerWatch, Rapidvideo.ws, TheVideoBee, Vidto, Streamin.To, XVIDSTAGE
|
||||||
- **XHamster**
|
- **XHamster**
|
||||||
- **XHamsterEmbed**
|
- **XHamsterEmbed**
|
||||||
|
- **xiami:album**: 虾米音乐 - 专辑
|
||||||
|
- **xiami:artist**: 虾米音乐 - 歌手
|
||||||
|
- **xiami:collection**: 虾米音乐 - 精选集
|
||||||
|
- **xiami:song**: 虾米音乐
|
||||||
- **XMinus**
|
- **XMinus**
|
||||||
- **XNXX**
|
- **XNXX**
|
||||||
- **Xstream**
|
- **Xstream**
|
||||||
@@ -791,6 +843,7 @@
|
|||||||
- **Ynet**
|
- **Ynet**
|
||||||
- **YouJizz**
|
- **YouJizz**
|
||||||
- **youku**: 优酷
|
- **youku**: 优酷
|
||||||
|
- **youku:show**
|
||||||
- **YouPorn**
|
- **YouPorn**
|
||||||
- **YourUpload**
|
- **YourUpload**
|
||||||
- **youtube**: YouTube.com
|
- **youtube**: YouTube.com
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
universal = True
|
universal = True
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
exclude = youtube_dl/extractor/__init__.py,devscripts/buildserver.py,devscripts/make_issue_template.py,setup.py,build,.git
|
exclude = youtube_dl/extractor/__init__.py,devscripts/buildserver.py,devscripts/lazy_load_template.py,devscripts/make_issue_template.py,setup.py,build,.git
|
||||||
ignore = E402,E501,E731
|
ignore = E402,E501,E731
|
||||||
|
|||||||
80
setup.py
80
setup.py
@@ -8,11 +8,12 @@ import warnings
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from setuptools import setup
|
from setuptools import setup, Command
|
||||||
setuptools_available = True
|
setuptools_available = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from distutils.core import setup
|
from distutils.core import setup, Command
|
||||||
setuptools_available = False
|
setuptools_available = False
|
||||||
|
from distutils.spawn import spawn
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# This will create an exe that needs Microsoft Visual C++ 2008
|
# This will create an exe that needs Microsoft Visual C++ 2008
|
||||||
@@ -20,25 +21,37 @@ try:
|
|||||||
import py2exe
|
import py2exe
|
||||||
except ImportError:
|
except ImportError:
|
||||||
if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
|
if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
|
||||||
print("Cannot import py2exe", file=sys.stderr)
|
print('Cannot import py2exe', file=sys.stderr)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
py2exe_options = {
|
py2exe_options = {
|
||||||
"bundle_files": 1,
|
'bundle_files': 1,
|
||||||
"compressed": 1,
|
'compressed': 1,
|
||||||
"optimize": 2,
|
'optimize': 2,
|
||||||
"dist_dir": '.',
|
'dist_dir': '.',
|
||||||
"dll_excludes": ['w9xpopen.exe', 'crypt32.dll'],
|
'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Get the version from youtube_dl/version.py without importing the package
|
||||||
|
exec(compile(open('youtube_dl/version.py').read(),
|
||||||
|
'youtube_dl/version.py', 'exec'))
|
||||||
|
|
||||||
|
DESCRIPTION = 'YouTube video downloader'
|
||||||
|
LONG_DESCRIPTION = 'Command-line program to download videos from YouTube.com and other video sites'
|
||||||
|
|
||||||
py2exe_console = [{
|
py2exe_console = [{
|
||||||
"script": "./youtube_dl/__main__.py",
|
'script': './youtube_dl/__main__.py',
|
||||||
"dest_base": "youtube-dl",
|
'dest_base': 'youtube-dl',
|
||||||
|
'version': __version__,
|
||||||
|
'description': DESCRIPTION,
|
||||||
|
'comments': LONG_DESCRIPTION,
|
||||||
|
'product_name': 'youtube-dl',
|
||||||
|
'product_version': __version__,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
py2exe_params = {
|
py2exe_params = {
|
||||||
'console': py2exe_console,
|
'console': py2exe_console,
|
||||||
'options': {"py2exe": py2exe_options},
|
'options': {'py2exe': py2exe_options},
|
||||||
'zipfile': None
|
'zipfile': None
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,16 +83,27 @@ else:
|
|||||||
else:
|
else:
|
||||||
params['scripts'] = ['bin/youtube-dl']
|
params['scripts'] = ['bin/youtube-dl']
|
||||||
|
|
||||||
# Get the version from youtube_dl/version.py without importing the package
|
class build_lazy_extractors(Command):
|
||||||
exec(compile(open('youtube_dl/version.py').read(),
|
description = 'Build the extractor lazy loading module'
|
||||||
'youtube_dl/version.py', 'exec'))
|
user_options = []
|
||||||
|
|
||||||
|
def initialize_options(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def finalize_options(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
spawn(
|
||||||
|
[sys.executable, 'devscripts/make_lazy_extractors.py', 'youtube_dl/extractor/lazy_extractors.py'],
|
||||||
|
dry_run=self.dry_run,
|
||||||
|
)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='youtube_dl',
|
name='youtube_dl',
|
||||||
version=__version__,
|
version=__version__,
|
||||||
description='YouTube video downloader',
|
description=DESCRIPTION,
|
||||||
long_description='Small command-line program to download videos from'
|
long_description=LONG_DESCRIPTION,
|
||||||
' YouTube.com and other video sites.',
|
|
||||||
url='https://github.com/rg3/youtube-dl',
|
url='https://github.com/rg3/youtube-dl',
|
||||||
author='Ricardo Garcia',
|
author='Ricardo Garcia',
|
||||||
author_email='ytdl@yt-dl.org',
|
author_email='ytdl@yt-dl.org',
|
||||||
@@ -95,17 +119,19 @@ setup(
|
|||||||
# test_requires = ['nosetest'],
|
# test_requires = ['nosetest'],
|
||||||
|
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Topic :: Multimedia :: Video",
|
'Topic :: Multimedia :: Video',
|
||||||
"Development Status :: 5 - Production/Stable",
|
'Development Status :: 5 - Production/Stable',
|
||||||
"Environment :: Console",
|
'Environment :: Console',
|
||||||
"License :: Public Domain",
|
'License :: Public Domain',
|
||||||
"Programming Language :: Python :: 2.6",
|
'Programming Language :: Python :: 2.6',
|
||||||
"Programming Language :: Python :: 2.7",
|
'Programming Language :: Python :: 2.7',
|
||||||
"Programming Language :: Python :: 3",
|
'Programming Language :: Python :: 3',
|
||||||
"Programming Language :: Python :: 3.2",
|
'Programming Language :: Python :: 3.2',
|
||||||
"Programming Language :: Python :: 3.3",
|
'Programming Language :: Python :: 3.3',
|
||||||
"Programming Language :: Python :: 3.4",
|
'Programming Language :: Python :: 3.4',
|
||||||
|
'Programming Language :: Python :: 3.5',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
cmdclass={'build_lazy_extractors': build_lazy_extractors},
|
||||||
**params
|
**params
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -24,8 +24,13 @@ from youtube_dl.utils import (
|
|||||||
def get_params(override=None):
|
def get_params(override=None):
|
||||||
PARAMETERS_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
PARAMETERS_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
||||||
"parameters.json")
|
"parameters.json")
|
||||||
|
LOCAL_PARAMETERS_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
||||||
|
"local_parameters.json")
|
||||||
with io.open(PARAMETERS_FILE, encoding='utf-8') as pf:
|
with io.open(PARAMETERS_FILE, encoding='utf-8') as pf:
|
||||||
parameters = json.load(pf)
|
parameters = json.load(pf)
|
||||||
|
if os.path.exists(LOCAL_PARAMETERS_FILE):
|
||||||
|
with io.open(LOCAL_PARAMETERS_FILE, encoding='utf-8') as pf:
|
||||||
|
parameters.update(json.load(pf))
|
||||||
if override:
|
if override:
|
||||||
parameters.update(override)
|
parameters.update(override)
|
||||||
return parameters
|
return parameters
|
||||||
@@ -143,6 +148,9 @@ def expect_value(self, got, expected, field):
|
|||||||
expect_value(self, item_got, item_expected, field)
|
expect_value(self, item_got, item_expected, field)
|
||||||
else:
|
else:
|
||||||
if isinstance(expected, compat_str) and expected.startswith('md5:'):
|
if isinstance(expected, compat_str) and expected.startswith('md5:'):
|
||||||
|
self.assertTrue(
|
||||||
|
isinstance(got, compat_str),
|
||||||
|
'Expected field %s to be a unicode object, but got value %r of type %r' % (field, got, type(got)))
|
||||||
got = 'md5:' + md5(got)
|
got = 'md5:' + md5(got)
|
||||||
elif isinstance(expected, compat_str) and expected.startswith('mincount:'):
|
elif isinstance(expected, compat_str) and expected.startswith('mincount:'):
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|||||||
from test.helper import FakeYDL
|
from test.helper import FakeYDL
|
||||||
from youtube_dl.extractor.common import InfoExtractor
|
from youtube_dl.extractor.common import InfoExtractor
|
||||||
from youtube_dl.extractor import YoutubeIE, get_info_extractor
|
from youtube_dl.extractor import YoutubeIE, get_info_extractor
|
||||||
|
from youtube_dl.utils import encode_data_uri, strip_jsonp, ExtractorError, RegexNotFoundError
|
||||||
|
|
||||||
|
|
||||||
class TestIE(InfoExtractor):
|
class TestIE(InfoExtractor):
|
||||||
@@ -65,6 +66,20 @@ class TestInfoExtractor(unittest.TestCase):
|
|||||||
self.assertEqual(ie._html_search_meta('d', html), '4')
|
self.assertEqual(ie._html_search_meta('d', html), '4')
|
||||||
self.assertEqual(ie._html_search_meta('e', html), '5')
|
self.assertEqual(ie._html_search_meta('e', html), '5')
|
||||||
self.assertEqual(ie._html_search_meta('f', html), '6')
|
self.assertEqual(ie._html_search_meta('f', html), '6')
|
||||||
|
self.assertEqual(ie._html_search_meta(('a', 'b', 'c'), html), '1')
|
||||||
|
self.assertEqual(ie._html_search_meta(('c', 'b', 'a'), html), '3')
|
||||||
|
self.assertEqual(ie._html_search_meta(('z', 'x', 'c'), html), '3')
|
||||||
|
self.assertRaises(RegexNotFoundError, ie._html_search_meta, 'z', html, None, fatal=True)
|
||||||
|
self.assertRaises(RegexNotFoundError, ie._html_search_meta, ('z', 'x'), html, None, fatal=True)
|
||||||
|
|
||||||
|
def test_download_json(self):
|
||||||
|
uri = encode_data_uri(b'{"foo": "blah"}', 'application/json')
|
||||||
|
self.assertEqual(self.ie._download_json(uri, None), {'foo': 'blah'})
|
||||||
|
uri = encode_data_uri(b'callback({"foo": "blah"})', 'application/javascript')
|
||||||
|
self.assertEqual(self.ie._download_json(uri, None, transform_source=strip_jsonp), {'foo': 'blah'})
|
||||||
|
uri = encode_data_uri(b'{"foo": invalid}', 'application/json')
|
||||||
|
self.assertRaises(ExtractorError, self.ie._download_json, uri, None)
|
||||||
|
self.assertEqual(self.ie._download_json(uri, None, fatal=False), None)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from __future__ import unicode_literals
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
|
import collections
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
|
|
||||||
@@ -130,6 +131,15 @@ class TestAllURLsMatching(unittest.TestCase):
|
|||||||
'https://screen.yahoo.com/smartwatches-latest-wearable-gadgets-163745379-cbs.html',
|
'https://screen.yahoo.com/smartwatches-latest-wearable-gadgets-163745379-cbs.html',
|
||||||
['Yahoo'])
|
['Yahoo'])
|
||||||
|
|
||||||
|
def test_no_duplicated_ie_names(self):
|
||||||
|
name_accu = collections.defaultdict(list)
|
||||||
|
for ie in self.ies:
|
||||||
|
name_accu[ie.IE_NAME.lower()].append(type(ie).__name__)
|
||||||
|
for (ie_name, ie_list) in name_accu.items():
|
||||||
|
self.assertEqual(
|
||||||
|
len(ie_list), 1,
|
||||||
|
'Multiple extractors with the same IE_NAME "%s" (%s)' % (ie_name, ', '.join(ie_list)))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@@ -10,13 +10,14 @@ import unittest
|
|||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
|
|
||||||
from youtube_dl.utils import get_filesystem_encoding
|
|
||||||
from youtube_dl.compat import (
|
from youtube_dl.compat import (
|
||||||
compat_getenv,
|
compat_getenv,
|
||||||
|
compat_setenv,
|
||||||
compat_etree_fromstring,
|
compat_etree_fromstring,
|
||||||
compat_expanduser,
|
compat_expanduser,
|
||||||
compat_shlex_split,
|
compat_shlex_split,
|
||||||
compat_str,
|
compat_str,
|
||||||
|
compat_struct_unpack,
|
||||||
compat_urllib_parse_unquote,
|
compat_urllib_parse_unquote,
|
||||||
compat_urllib_parse_unquote_plus,
|
compat_urllib_parse_unquote_plus,
|
||||||
compat_urllib_parse_urlencode,
|
compat_urllib_parse_urlencode,
|
||||||
@@ -26,19 +27,22 @@ from youtube_dl.compat import (
|
|||||||
class TestCompat(unittest.TestCase):
|
class TestCompat(unittest.TestCase):
|
||||||
def test_compat_getenv(self):
|
def test_compat_getenv(self):
|
||||||
test_str = 'тест'
|
test_str = 'тест'
|
||||||
os.environ['YOUTUBE-DL-TEST'] = (
|
compat_setenv('YOUTUBE-DL-TEST', test_str)
|
||||||
test_str if sys.version_info >= (3, 0)
|
|
||||||
else test_str.encode(get_filesystem_encoding()))
|
|
||||||
self.assertEqual(compat_getenv('YOUTUBE-DL-TEST'), test_str)
|
self.assertEqual(compat_getenv('YOUTUBE-DL-TEST'), test_str)
|
||||||
|
|
||||||
|
def test_compat_setenv(self):
|
||||||
|
test_var = 'YOUTUBE-DL-TEST'
|
||||||
|
test_str = 'тест'
|
||||||
|
compat_setenv(test_var, test_str)
|
||||||
|
compat_getenv(test_var)
|
||||||
|
self.assertEqual(compat_getenv(test_var), test_str)
|
||||||
|
|
||||||
def test_compat_expanduser(self):
|
def test_compat_expanduser(self):
|
||||||
old_home = os.environ.get('HOME')
|
old_home = os.environ.get('HOME')
|
||||||
test_str = 'C:\Documents and Settings\тест\Application Data'
|
test_str = 'C:\Documents and Settings\тест\Application Data'
|
||||||
os.environ['HOME'] = (
|
compat_setenv('HOME', test_str)
|
||||||
test_str if sys.version_info >= (3, 0)
|
|
||||||
else test_str.encode(get_filesystem_encoding()))
|
|
||||||
self.assertEqual(compat_expanduser('~'), test_str)
|
self.assertEqual(compat_expanduser('~'), test_str)
|
||||||
os.environ['HOME'] = old_home
|
compat_setenv('HOME', old_home or '')
|
||||||
|
|
||||||
def test_all_present(self):
|
def test_all_present(self):
|
||||||
import youtube_dl.compat
|
import youtube_dl.compat
|
||||||
@@ -83,6 +87,7 @@ class TestCompat(unittest.TestCase):
|
|||||||
|
|
||||||
def test_compat_shlex_split(self):
|
def test_compat_shlex_split(self):
|
||||||
self.assertEqual(compat_shlex_split('-option "one two"'), ['-option', 'one two'])
|
self.assertEqual(compat_shlex_split('-option "one two"'), ['-option', 'one two'])
|
||||||
|
self.assertEqual(compat_shlex_split('-option "one\ntwo" \n -flag'), ['-option', 'one\ntwo', '-flag'])
|
||||||
|
|
||||||
def test_compat_etree_fromstring(self):
|
def test_compat_etree_fromstring(self):
|
||||||
xml = '''
|
xml = '''
|
||||||
@@ -99,5 +104,15 @@ class TestCompat(unittest.TestCase):
|
|||||||
self.assertTrue(isinstance(doc.find('chinese').text, compat_str))
|
self.assertTrue(isinstance(doc.find('chinese').text, compat_str))
|
||||||
self.assertTrue(isinstance(doc.find('foo/bar').text, compat_str))
|
self.assertTrue(isinstance(doc.find('foo/bar').text, compat_str))
|
||||||
|
|
||||||
|
def test_compat_etree_fromstring_doctype(self):
|
||||||
|
xml = '''<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE smil PUBLIC "-//W3C//DTD SMIL 2.0//EN" "http://www.w3.org/2001/SMIL20/SMIL20.dtd">
|
||||||
|
<smil xmlns="http://www.w3.org/2001/SMIL20/Language"></smil>'''
|
||||||
|
compat_etree_fromstring(xml)
|
||||||
|
|
||||||
|
def test_struct_unpack(self):
|
||||||
|
self.assertEqual(compat_struct_unpack('!B', b'\x00'), (0,))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@@ -16,6 +16,15 @@ import threading
|
|||||||
TEST_DIR = os.path.dirname(os.path.abspath(__file__))
|
TEST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
|
|
||||||
|
def http_server_port(httpd):
|
||||||
|
if os.name == 'java' and isinstance(httpd.socket, ssl.SSLSocket):
|
||||||
|
# In Jython SSLSocket is not a subclass of socket.socket
|
||||||
|
sock = httpd.socket.sock
|
||||||
|
else:
|
||||||
|
sock = httpd.socket
|
||||||
|
return sock.getsockname()[1]
|
||||||
|
|
||||||
|
|
||||||
class HTTPTestRequestHandler(compat_http_server.BaseHTTPRequestHandler):
|
class HTTPTestRequestHandler(compat_http_server.BaseHTTPRequestHandler):
|
||||||
def log_message(self, format, *args):
|
def log_message(self, format, *args):
|
||||||
pass
|
pass
|
||||||
@@ -31,6 +40,22 @@ class HTTPTestRequestHandler(compat_http_server.BaseHTTPRequestHandler):
|
|||||||
self.send_header('Content-Type', 'video/mp4')
|
self.send_header('Content-Type', 'video/mp4')
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
self.wfile.write(b'\x00\x00\x00\x00\x20\x66\x74[video]')
|
self.wfile.write(b'\x00\x00\x00\x00\x20\x66\x74[video]')
|
||||||
|
elif self.path == '/302':
|
||||||
|
if sys.version_info[0] == 3:
|
||||||
|
# XXX: Python 3 http server does not allow non-ASCII header values
|
||||||
|
self.send_response(404)
|
||||||
|
self.end_headers()
|
||||||
|
return
|
||||||
|
|
||||||
|
new_url = 'http://localhost:%d/中文.html' % http_server_port(self.server)
|
||||||
|
self.send_response(302)
|
||||||
|
self.send_header(b'Location', new_url.encode('utf-8'))
|
||||||
|
self.end_headers()
|
||||||
|
elif self.path == '/%E4%B8%AD%E6%96%87.html':
|
||||||
|
self.send_response(200)
|
||||||
|
self.send_header('Content-Type', 'text/html; charset=utf-8')
|
||||||
|
self.end_headers()
|
||||||
|
self.wfile.write(b'<html><video src="/vid.mp4" /></html>')
|
||||||
else:
|
else:
|
||||||
assert False
|
assert False
|
||||||
|
|
||||||
@@ -47,18 +72,32 @@ class FakeLogger(object):
|
|||||||
|
|
||||||
|
|
||||||
class TestHTTP(unittest.TestCase):
|
class TestHTTP(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.httpd = compat_http_server.HTTPServer(
|
||||||
|
('localhost', 0), HTTPTestRequestHandler)
|
||||||
|
self.port = http_server_port(self.httpd)
|
||||||
|
self.server_thread = threading.Thread(target=self.httpd.serve_forever)
|
||||||
|
self.server_thread.daemon = True
|
||||||
|
self.server_thread.start()
|
||||||
|
|
||||||
|
def test_unicode_path_redirection(self):
|
||||||
|
# XXX: Python 3 http server does not allow non-ASCII header values
|
||||||
|
if sys.version_info[0] == 3:
|
||||||
|
return
|
||||||
|
|
||||||
|
ydl = YoutubeDL({'logger': FakeLogger()})
|
||||||
|
r = ydl.extract_info('http://localhost:%d/302' % self.port)
|
||||||
|
self.assertEqual(r['url'], 'http://localhost:%d/vid.mp4' % self.port)
|
||||||
|
|
||||||
|
|
||||||
|
class TestHTTPS(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
certfn = os.path.join(TEST_DIR, 'testcert.pem')
|
certfn = os.path.join(TEST_DIR, 'testcert.pem')
|
||||||
self.httpd = compat_http_server.HTTPServer(
|
self.httpd = compat_http_server.HTTPServer(
|
||||||
('localhost', 0), HTTPTestRequestHandler)
|
('localhost', 0), HTTPTestRequestHandler)
|
||||||
self.httpd.socket = ssl.wrap_socket(
|
self.httpd.socket = ssl.wrap_socket(
|
||||||
self.httpd.socket, certfile=certfn, server_side=True)
|
self.httpd.socket, certfile=certfn, server_side=True)
|
||||||
if os.name == 'java':
|
self.port = http_server_port(self.httpd)
|
||||||
# In Jython SSLSocket is not a subclass of socket.socket
|
|
||||||
sock = self.httpd.socket.sock
|
|
||||||
else:
|
|
||||||
sock = self.httpd.socket
|
|
||||||
self.port = sock.getsockname()[1]
|
|
||||||
self.server_thread = threading.Thread(target=self.httpd.serve_forever)
|
self.server_thread = threading.Thread(target=self.httpd.serve_forever)
|
||||||
self.server_thread.daemon = True
|
self.server_thread.daemon = True
|
||||||
self.server_thread.start()
|
self.server_thread.start()
|
||||||
@@ -94,14 +133,14 @@ class TestProxy(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.proxy = compat_http_server.HTTPServer(
|
self.proxy = compat_http_server.HTTPServer(
|
||||||
('localhost', 0), _build_proxy_handler('normal'))
|
('localhost', 0), _build_proxy_handler('normal'))
|
||||||
self.port = self.proxy.socket.getsockname()[1]
|
self.port = http_server_port(self.proxy)
|
||||||
self.proxy_thread = threading.Thread(target=self.proxy.serve_forever)
|
self.proxy_thread = threading.Thread(target=self.proxy.serve_forever)
|
||||||
self.proxy_thread.daemon = True
|
self.proxy_thread.daemon = True
|
||||||
self.proxy_thread.start()
|
self.proxy_thread.start()
|
||||||
|
|
||||||
self.cn_proxy = compat_http_server.HTTPServer(
|
self.cn_proxy = compat_http_server.HTTPServer(
|
||||||
('localhost', 0), _build_proxy_handler('cn'))
|
('localhost', 0), _build_proxy_handler('cn'))
|
||||||
self.cn_port = self.cn_proxy.socket.getsockname()[1]
|
self.cn_port = http_server_port(self.cn_proxy)
|
||||||
self.cn_proxy_thread = threading.Thread(target=self.cn_proxy.serve_forever)
|
self.cn_proxy_thread = threading.Thread(target=self.cn_proxy.serve_forever)
|
||||||
self.cn_proxy_thread.daemon = True
|
self.cn_proxy_thread.daemon = True
|
||||||
self.cn_proxy_thread.start()
|
self.cn_proxy_thread.start()
|
||||||
|
|||||||
118
test/test_socks.py
Normal file
118
test/test_socks.py
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
# Allow direct execution
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import unittest
|
||||||
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
|
import random
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from test.helper import (
|
||||||
|
FakeYDL,
|
||||||
|
get_params,
|
||||||
|
)
|
||||||
|
from youtube_dl.compat import (
|
||||||
|
compat_str,
|
||||||
|
compat_urllib_request,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class TestMultipleSocks(unittest.TestCase):
|
||||||
|
@staticmethod
|
||||||
|
def _check_params(attrs):
|
||||||
|
params = get_params()
|
||||||
|
for attr in attrs:
|
||||||
|
if attr not in params:
|
||||||
|
print('Missing %s. Skipping.' % attr)
|
||||||
|
return
|
||||||
|
return params
|
||||||
|
|
||||||
|
def test_proxy_http(self):
|
||||||
|
params = self._check_params(['primary_proxy', 'primary_server_ip'])
|
||||||
|
if params is None:
|
||||||
|
return
|
||||||
|
ydl = FakeYDL({
|
||||||
|
'proxy': params['primary_proxy']
|
||||||
|
})
|
||||||
|
self.assertEqual(
|
||||||
|
ydl.urlopen('http://yt-dl.org/ip').read().decode('utf-8'),
|
||||||
|
params['primary_server_ip'])
|
||||||
|
|
||||||
|
def test_proxy_https(self):
|
||||||
|
params = self._check_params(['primary_proxy', 'primary_server_ip'])
|
||||||
|
if params is None:
|
||||||
|
return
|
||||||
|
ydl = FakeYDL({
|
||||||
|
'proxy': params['primary_proxy']
|
||||||
|
})
|
||||||
|
self.assertEqual(
|
||||||
|
ydl.urlopen('https://yt-dl.org/ip').read().decode('utf-8'),
|
||||||
|
params['primary_server_ip'])
|
||||||
|
|
||||||
|
def test_secondary_proxy_http(self):
|
||||||
|
params = self._check_params(['secondary_proxy', 'secondary_server_ip'])
|
||||||
|
if params is None:
|
||||||
|
return
|
||||||
|
ydl = FakeYDL()
|
||||||
|
req = compat_urllib_request.Request('http://yt-dl.org/ip')
|
||||||
|
req.add_header('Ytdl-request-proxy', params['secondary_proxy'])
|
||||||
|
self.assertEqual(
|
||||||
|
ydl.urlopen(req).read().decode('utf-8'),
|
||||||
|
params['secondary_server_ip'])
|
||||||
|
|
||||||
|
def test_secondary_proxy_https(self):
|
||||||
|
params = self._check_params(['secondary_proxy', 'secondary_server_ip'])
|
||||||
|
if params is None:
|
||||||
|
return
|
||||||
|
ydl = FakeYDL()
|
||||||
|
req = compat_urllib_request.Request('https://yt-dl.org/ip')
|
||||||
|
req.add_header('Ytdl-request-proxy', params['secondary_proxy'])
|
||||||
|
self.assertEqual(
|
||||||
|
ydl.urlopen(req).read().decode('utf-8'),
|
||||||
|
params['secondary_server_ip'])
|
||||||
|
|
||||||
|
|
||||||
|
class TestSocks(unittest.TestCase):
|
||||||
|
_SKIP_SOCKS_TEST = True
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
if self._SKIP_SOCKS_TEST:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.port = random.randint(20000, 30000)
|
||||||
|
self.server_process = subprocess.Popen([
|
||||||
|
'srelay', '-f', '-i', '127.0.0.1:%d' % self.port],
|
||||||
|
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
if self._SKIP_SOCKS_TEST:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.server_process.terminate()
|
||||||
|
self.server_process.communicate()
|
||||||
|
|
||||||
|
def _get_ip(self, protocol):
|
||||||
|
if self._SKIP_SOCKS_TEST:
|
||||||
|
return '127.0.0.1'
|
||||||
|
|
||||||
|
ydl = FakeYDL({
|
||||||
|
'proxy': '%s://127.0.0.1:%d' % (protocol, self.port),
|
||||||
|
})
|
||||||
|
return ydl.urlopen('http://yt-dl.org/ip').read().decode('utf-8')
|
||||||
|
|
||||||
|
def test_socks4(self):
|
||||||
|
self.assertTrue(isinstance(self._get_ip('socks4'), compat_str))
|
||||||
|
|
||||||
|
def test_socks4a(self):
|
||||||
|
self.assertTrue(isinstance(self._get_ip('socks4a'), compat_str))
|
||||||
|
|
||||||
|
def test_socks5(self):
|
||||||
|
self.assertTrue(isinstance(self._get_ip('socks5'), compat_str))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
@@ -20,6 +20,7 @@ from youtube_dl.utils import (
|
|||||||
args_to_str,
|
args_to_str,
|
||||||
encode_base_n,
|
encode_base_n,
|
||||||
clean_html,
|
clean_html,
|
||||||
|
date_from_str,
|
||||||
DateRange,
|
DateRange,
|
||||||
detect_exe_version,
|
detect_exe_version,
|
||||||
determine_ext,
|
determine_ext,
|
||||||
@@ -49,20 +50,23 @@ from youtube_dl.utils import (
|
|||||||
sanitize_path,
|
sanitize_path,
|
||||||
prepend_extension,
|
prepend_extension,
|
||||||
replace_extension,
|
replace_extension,
|
||||||
|
remove_start,
|
||||||
|
remove_end,
|
||||||
remove_quotes,
|
remove_quotes,
|
||||||
shell_quote,
|
shell_quote,
|
||||||
smuggle_url,
|
smuggle_url,
|
||||||
str_to_int,
|
str_to_int,
|
||||||
strip_jsonp,
|
strip_jsonp,
|
||||||
struct_unpack,
|
|
||||||
timeconvert,
|
timeconvert,
|
||||||
unescapeHTML,
|
unescapeHTML,
|
||||||
unified_strdate,
|
unified_strdate,
|
||||||
|
unified_timestamp,
|
||||||
unsmuggle_url,
|
unsmuggle_url,
|
||||||
uppercase_escape,
|
uppercase_escape,
|
||||||
lowercase_escape,
|
lowercase_escape,
|
||||||
url_basename,
|
url_basename,
|
||||||
urlencode_postdata,
|
urlencode_postdata,
|
||||||
|
urshift,
|
||||||
update_url_query,
|
update_url_query,
|
||||||
version_tuple,
|
version_tuple,
|
||||||
xpath_with_ns,
|
xpath_with_ns,
|
||||||
@@ -138,8 +142,8 @@ class TestUtil(unittest.TestCase):
|
|||||||
self.assertEqual('yes_no', sanitize_filename('yes? no', restricted=True))
|
self.assertEqual('yes_no', sanitize_filename('yes? no', restricted=True))
|
||||||
self.assertEqual('this_-_that', sanitize_filename('this: that', restricted=True))
|
self.assertEqual('this_-_that', sanitize_filename('this: that', restricted=True))
|
||||||
|
|
||||||
tests = 'a\xe4b\u4e2d\u56fd\u7684c'
|
tests = 'aäb\u4e2d\u56fd\u7684c'
|
||||||
self.assertEqual(sanitize_filename(tests, restricted=True), 'a_b_c')
|
self.assertEqual(sanitize_filename(tests, restricted=True), 'aab_c')
|
||||||
self.assertTrue(sanitize_filename('\xf6', restricted=True) != '') # No empty filename
|
self.assertTrue(sanitize_filename('\xf6', restricted=True) != '') # No empty filename
|
||||||
|
|
||||||
forbidden = '"\0\\/&!: \'\t\n()[]{}$;`^,#'
|
forbidden = '"\0\\/&!: \'\t\n()[]{}$;`^,#'
|
||||||
@@ -154,6 +158,10 @@ class TestUtil(unittest.TestCase):
|
|||||||
self.assertTrue(sanitize_filename('-', restricted=True) != '')
|
self.assertTrue(sanitize_filename('-', restricted=True) != '')
|
||||||
self.assertTrue(sanitize_filename(':', restricted=True) != '')
|
self.assertTrue(sanitize_filename(':', restricted=True) != '')
|
||||||
|
|
||||||
|
self.assertEqual(sanitize_filename(
|
||||||
|
'ÂÃÄÀÁÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖŐØŒÙÚÛÜŰÝÞßàáâãäåæçèéêëìíîïðñòóôõöőøœùúûüűýþÿ', restricted=True),
|
||||||
|
'AAAAAAAECEEEEIIIIDNOOOOOOOOEUUUUUYPssaaaaaaaeceeeeiiiionooooooooeuuuuuypy')
|
||||||
|
|
||||||
def test_sanitize_ids(self):
|
def test_sanitize_ids(self):
|
||||||
self.assertEqual(sanitize_filename('_n_cd26wFpw', is_id=True), '_n_cd26wFpw')
|
self.assertEqual(sanitize_filename('_n_cd26wFpw', is_id=True), '_n_cd26wFpw')
|
||||||
self.assertEqual(sanitize_filename('_BD_eEpuzXw', is_id=True), '_BD_eEpuzXw')
|
self.assertEqual(sanitize_filename('_BD_eEpuzXw', is_id=True), '_BD_eEpuzXw')
|
||||||
@@ -211,6 +219,16 @@ class TestUtil(unittest.TestCase):
|
|||||||
self.assertEqual(replace_extension('.abc', 'temp'), '.abc.temp')
|
self.assertEqual(replace_extension('.abc', 'temp'), '.abc.temp')
|
||||||
self.assertEqual(replace_extension('.abc.ext', 'temp'), '.abc.temp')
|
self.assertEqual(replace_extension('.abc.ext', 'temp'), '.abc.temp')
|
||||||
|
|
||||||
|
def test_remove_start(self):
|
||||||
|
self.assertEqual(remove_start(None, 'A - '), None)
|
||||||
|
self.assertEqual(remove_start('A - B', 'A - '), 'B')
|
||||||
|
self.assertEqual(remove_start('B - A', 'A - '), 'B - A')
|
||||||
|
|
||||||
|
def test_remove_end(self):
|
||||||
|
self.assertEqual(remove_end(None, ' - B'), None)
|
||||||
|
self.assertEqual(remove_end('A - B', ' - B'), 'A')
|
||||||
|
self.assertEqual(remove_end('B - A', ' - B'), 'B - A')
|
||||||
|
|
||||||
def test_remove_quotes(self):
|
def test_remove_quotes(self):
|
||||||
self.assertEqual(remove_quotes(None), None)
|
self.assertEqual(remove_quotes(None), None)
|
||||||
self.assertEqual(remove_quotes('"'), '"')
|
self.assertEqual(remove_quotes('"'), '"')
|
||||||
@@ -233,6 +251,15 @@ class TestUtil(unittest.TestCase):
|
|||||||
self.assertEqual(unescapeHTML('/'), '/')
|
self.assertEqual(unescapeHTML('/'), '/')
|
||||||
self.assertEqual(unescapeHTML('é'), 'é')
|
self.assertEqual(unescapeHTML('é'), 'é')
|
||||||
self.assertEqual(unescapeHTML('�'), '�')
|
self.assertEqual(unescapeHTML('�'), '�')
|
||||||
|
# HTML5 entities
|
||||||
|
self.assertEqual(unescapeHTML('.''), '.\'')
|
||||||
|
|
||||||
|
def test_date_from_str(self):
|
||||||
|
self.assertEqual(date_from_str('yesterday'), date_from_str('now-1day'))
|
||||||
|
self.assertEqual(date_from_str('now+7day'), date_from_str('now+1week'))
|
||||||
|
self.assertEqual(date_from_str('now+14day'), date_from_str('now+2week'))
|
||||||
|
self.assertEqual(date_from_str('now+365day'), date_from_str('now+1year'))
|
||||||
|
self.assertEqual(date_from_str('now+30day'), date_from_str('now+1month'))
|
||||||
|
|
||||||
def test_daterange(self):
|
def test_daterange(self):
|
||||||
_20century = DateRange("19000101", "20000101")
|
_20century = DateRange("19000101", "20000101")
|
||||||
@@ -258,8 +285,28 @@ class TestUtil(unittest.TestCase):
|
|||||||
'20150202')
|
'20150202')
|
||||||
self.assertEqual(unified_strdate('Feb 14th 2016 5:45PM'), '20160214')
|
self.assertEqual(unified_strdate('Feb 14th 2016 5:45PM'), '20160214')
|
||||||
self.assertEqual(unified_strdate('25-09-2014'), '20140925')
|
self.assertEqual(unified_strdate('25-09-2014'), '20140925')
|
||||||
|
self.assertEqual(unified_strdate('27.02.2016 17:30'), '20160227')
|
||||||
self.assertEqual(unified_strdate('UNKNOWN DATE FORMAT'), None)
|
self.assertEqual(unified_strdate('UNKNOWN DATE FORMAT'), None)
|
||||||
|
|
||||||
|
def test_unified_timestamps(self):
|
||||||
|
self.assertEqual(unified_timestamp('December 21, 2010'), 1292889600)
|
||||||
|
self.assertEqual(unified_timestamp('8/7/2009'), 1247011200)
|
||||||
|
self.assertEqual(unified_timestamp('Dec 14, 2012'), 1355443200)
|
||||||
|
self.assertEqual(unified_timestamp('2012/10/11 01:56:38 +0000'), 1349920598)
|
||||||
|
self.assertEqual(unified_timestamp('1968 12 10'), -33436800)
|
||||||
|
self.assertEqual(unified_timestamp('1968-12-10'), -33436800)
|
||||||
|
self.assertEqual(unified_timestamp('28/01/2014 21:00:00 +0100'), 1390939200)
|
||||||
|
self.assertEqual(
|
||||||
|
unified_timestamp('11/26/2014 11:30:00 AM PST', day_first=False),
|
||||||
|
1417001400)
|
||||||
|
self.assertEqual(
|
||||||
|
unified_timestamp('2/2/2015 6:47:40 PM', day_first=False),
|
||||||
|
1422902860)
|
||||||
|
self.assertEqual(unified_timestamp('Feb 14th 2016 5:45PM'), 1455471900)
|
||||||
|
self.assertEqual(unified_timestamp('25-09-2014'), 1411603200)
|
||||||
|
self.assertEqual(unified_timestamp('27.02.2016 17:30'), 1456594200)
|
||||||
|
self.assertEqual(unified_timestamp('UNKNOWN DATE FORMAT'), None)
|
||||||
|
|
||||||
def test_determine_ext(self):
|
def test_determine_ext(self):
|
||||||
self.assertEqual(determine_ext('http://example.com/foo/bar.mp4/?download'), 'mp4')
|
self.assertEqual(determine_ext('http://example.com/foo/bar.mp4/?download'), 'mp4')
|
||||||
self.assertEqual(determine_ext('http://example.com/foo/bar/?download', None), None)
|
self.assertEqual(determine_ext('http://example.com/foo/bar/?download', None), None)
|
||||||
@@ -405,6 +452,7 @@ class TestUtil(unittest.TestCase):
|
|||||||
self.assertEqual(parse_duration('01:02:03:04'), 93784)
|
self.assertEqual(parse_duration('01:02:03:04'), 93784)
|
||||||
self.assertEqual(parse_duration('1 hour 3 minutes'), 3780)
|
self.assertEqual(parse_duration('1 hour 3 minutes'), 3780)
|
||||||
self.assertEqual(parse_duration('87 Min.'), 5220)
|
self.assertEqual(parse_duration('87 Min.'), 5220)
|
||||||
|
self.assertEqual(parse_duration('PT1H0.040S'), 3600.04)
|
||||||
|
|
||||||
def test_fix_xml_ampersands(self):
|
def test_fix_xml_ampersands(self):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
@@ -444,9 +492,6 @@ class TestUtil(unittest.TestCase):
|
|||||||
testPL(5, 2, (2, 99), [2, 3, 4])
|
testPL(5, 2, (2, 99), [2, 3, 4])
|
||||||
testPL(5, 2, (20, 99), [])
|
testPL(5, 2, (20, 99), [])
|
||||||
|
|
||||||
def test_struct_unpack(self):
|
|
||||||
self.assertEqual(struct_unpack('!B', b'\x00'), (0,))
|
|
||||||
|
|
||||||
def test_read_batch_urls(self):
|
def test_read_batch_urls(self):
|
||||||
f = io.StringIO('''\xef\xbb\xbf foo
|
f = io.StringIO('''\xef\xbb\xbf foo
|
||||||
bar\r
|
bar\r
|
||||||
@@ -608,6 +653,18 @@ class TestUtil(unittest.TestCase):
|
|||||||
json_code = js_to_json(inp)
|
json_code = js_to_json(inp)
|
||||||
self.assertEqual(json.loads(json_code), json.loads(inp))
|
self.assertEqual(json.loads(json_code), json.loads(inp))
|
||||||
|
|
||||||
|
inp = '''{
|
||||||
|
0:{src:'skipped', type: 'application/dash+xml'},
|
||||||
|
1:{src:'skipped', type: 'application/vnd.apple.mpegURL'},
|
||||||
|
}'''
|
||||||
|
self.assertEqual(js_to_json(inp), '''{
|
||||||
|
"0":{"src":"skipped", "type": "application/dash+xml"},
|
||||||
|
"1":{"src":"skipped", "type": "application/vnd.apple.mpegURL"}
|
||||||
|
}''')
|
||||||
|
|
||||||
|
inp = '''{"foo":101}'''
|
||||||
|
self.assertEqual(js_to_json(inp), '''{"foo":101}''')
|
||||||
|
|
||||||
def test_js_to_json_edgecases(self):
|
def test_js_to_json_edgecases(self):
|
||||||
on = js_to_json("{abc_def:'1\\'\\\\2\\\\\\'3\"4'}")
|
on = js_to_json("{abc_def:'1\\'\\\\2\\\\\\'3\"4'}")
|
||||||
self.assertEqual(json.loads(on), {"abc_def": "1'\\2\\'3\"4"})
|
self.assertEqual(json.loads(on), {"abc_def": "1'\\2\\'3\"4"})
|
||||||
@@ -631,6 +688,27 @@ class TestUtil(unittest.TestCase):
|
|||||||
on = js_to_json('{"abc": "def",}')
|
on = js_to_json('{"abc": "def",}')
|
||||||
self.assertEqual(json.loads(on), {'abc': 'def'})
|
self.assertEqual(json.loads(on), {'abc': 'def'})
|
||||||
|
|
||||||
|
on = js_to_json('{ 0: /* " \n */ ",]" , }')
|
||||||
|
self.assertEqual(json.loads(on), {'0': ',]'})
|
||||||
|
|
||||||
|
on = js_to_json(r'["<p>x<\/p>"]')
|
||||||
|
self.assertEqual(json.loads(on), ['<p>x</p>'])
|
||||||
|
|
||||||
|
on = js_to_json(r'["\xaa"]')
|
||||||
|
self.assertEqual(json.loads(on), ['\u00aa'])
|
||||||
|
|
||||||
|
on = js_to_json("['a\\\nb']")
|
||||||
|
self.assertEqual(json.loads(on), ['ab'])
|
||||||
|
|
||||||
|
on = js_to_json('{0xff:0xff}')
|
||||||
|
self.assertEqual(json.loads(on), {'255': 255})
|
||||||
|
|
||||||
|
on = js_to_json('{077:077}')
|
||||||
|
self.assertEqual(json.loads(on), {'63': 63})
|
||||||
|
|
||||||
|
on = js_to_json('{42:42}')
|
||||||
|
self.assertEqual(json.loads(on), {'42': 42})
|
||||||
|
|
||||||
def test_extract_attributes(self):
|
def test_extract_attributes(self):
|
||||||
self.assertEqual(extract_attributes('<e x="y">'), {'x': 'y'})
|
self.assertEqual(extract_attributes('<e x="y">'), {'x': 'y'})
|
||||||
self.assertEqual(extract_attributes("<e x='y'>"), {'x': 'y'})
|
self.assertEqual(extract_attributes("<e x='y'>"), {'x': 'y'})
|
||||||
@@ -903,5 +981,9 @@ The first line
|
|||||||
self.assertRaises(ValueError, encode_base_n, 0, 70)
|
self.assertRaises(ValueError, encode_base_n, 0, 70)
|
||||||
self.assertRaises(ValueError, encode_base_n, 0, 60, custom_table)
|
self.assertRaises(ValueError, encode_base_n, 0, 60, custom_table)
|
||||||
|
|
||||||
|
def test_urshift(self):
|
||||||
|
self.assertEqual(urshift(3, 1), 1)
|
||||||
|
self.assertEqual(urshift(-3, 1), 2147483646)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class TestYoutubeLists(unittest.TestCase):
|
|||||||
ie = YoutubePlaylistIE(dl)
|
ie = YoutubePlaylistIE(dl)
|
||||||
result = ie.extract('https://www.youtube.com/watch?v=W01L70IGBgE&index=2&list=RDOQpdSVF_k_w')
|
result = ie.extract('https://www.youtube.com/watch?v=W01L70IGBgE&index=2&list=RDOQpdSVF_k_w')
|
||||||
entries = result['entries']
|
entries = result['entries']
|
||||||
self.assertTrue(len(entries) >= 20)
|
self.assertTrue(len(entries) >= 50)
|
||||||
original_video = entries[0]
|
original_video = entries[0]
|
||||||
self.assertEqual(original_video['id'], 'OQpdSVF_k_w')
|
self.assertEqual(original_video['id'], 'OQpdSVF_k_w')
|
||||||
|
|
||||||
|
|||||||
1
tox.ini
1
tox.ini
@@ -9,5 +9,6 @@ passenv = HOME
|
|||||||
defaultargs = test --exclude test_download.py --exclude test_age_restriction.py
|
defaultargs = test --exclude test_download.py --exclude test_age_restriction.py
|
||||||
--exclude test_subtitles.py --exclude test_write_annotations.py
|
--exclude test_subtitles.py --exclude test_write_annotations.py
|
||||||
--exclude test_youtube_lists.py --exclude test_iqiyi_sdk_interpreter.py
|
--exclude test_youtube_lists.py --exclude test_iqiyi_sdk_interpreter.py
|
||||||
|
--exclude test_socks.py
|
||||||
commands = nosetests --verbose {posargs:{[testenv]defaultargs}} # --with-coverage --cover-package=youtube_dl --cover-html
|
commands = nosetests --verbose {posargs:{[testenv]defaultargs}} # --with-coverage --cover-package=youtube_dl --cover-html
|
||||||
# test.test_download:TestDownload.test_NowVideo
|
# test.test_download:TestDownload.test_NowVideo
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ from .utils import (
|
|||||||
PostProcessingError,
|
PostProcessingError,
|
||||||
preferredencoding,
|
preferredencoding,
|
||||||
prepend_extension,
|
prepend_extension,
|
||||||
|
register_socks_protocols,
|
||||||
render_table,
|
render_table,
|
||||||
replace_extension,
|
replace_extension,
|
||||||
SameFileError,
|
SameFileError,
|
||||||
@@ -82,7 +83,7 @@ from .utils import (
|
|||||||
YoutubeDLHandler,
|
YoutubeDLHandler,
|
||||||
)
|
)
|
||||||
from .cache import Cache
|
from .cache import Cache
|
||||||
from .extractor import get_info_extractor, gen_extractors
|
from .extractor import get_info_extractor, gen_extractor_classes, _LAZY_LOADER
|
||||||
from .downloader import get_suitable_downloader
|
from .downloader import get_suitable_downloader
|
||||||
from .downloader.rtmp import rtmpdump_version
|
from .downloader.rtmp import rtmpdump_version
|
||||||
from .postprocessor import (
|
from .postprocessor import (
|
||||||
@@ -260,7 +261,9 @@ class YoutubeDL(object):
|
|||||||
The following options determine which downloader is picked:
|
The following options determine which downloader is picked:
|
||||||
external_downloader: Executable of the external downloader to call.
|
external_downloader: Executable of the external downloader to call.
|
||||||
None or unset for standard (built-in) downloader.
|
None or unset for standard (built-in) downloader.
|
||||||
hls_prefer_native: Use the native HLS downloader instead of ffmpeg/avconv.
|
hls_prefer_native: Use the native HLS downloader instead of ffmpeg/avconv
|
||||||
|
if True, otherwise use ffmpeg/avconv if False, otherwise
|
||||||
|
use downloader suggested by extractor if None.
|
||||||
|
|
||||||
The following parameters are not used by YoutubeDL itself, they are used by
|
The following parameters are not used by YoutubeDL itself, they are used by
|
||||||
the downloader (see youtube_dl/downloader/common.py):
|
the downloader (see youtube_dl/downloader/common.py):
|
||||||
@@ -323,7 +326,7 @@ class YoutubeDL(object):
|
|||||||
['fribidi', '-c', 'UTF-8'] + width_args, **sp_kwargs)
|
['fribidi', '-c', 'UTF-8'] + width_args, **sp_kwargs)
|
||||||
self._output_channel = os.fdopen(master, 'rb')
|
self._output_channel = os.fdopen(master, 'rb')
|
||||||
except OSError as ose:
|
except OSError as ose:
|
||||||
if ose.errno == 2:
|
if ose.errno == errno.ENOENT:
|
||||||
self.report_warning('Could not find fribidi executable, ignoring --bidi-workaround . Make sure that fribidi is an executable file in one of the directories in your $PATH.')
|
self.report_warning('Could not find fribidi executable, ignoring --bidi-workaround . Make sure that fribidi is an executable file in one of the directories in your $PATH.')
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
@@ -359,6 +362,8 @@ class YoutubeDL(object):
|
|||||||
for ph in self.params.get('progress_hooks', []):
|
for ph in self.params.get('progress_hooks', []):
|
||||||
self.add_progress_hook(ph)
|
self.add_progress_hook(ph)
|
||||||
|
|
||||||
|
register_socks_protocols()
|
||||||
|
|
||||||
def warn_if_short_id(self, argv):
|
def warn_if_short_id(self, argv):
|
||||||
# short YouTube ID starting with dash?
|
# short YouTube ID starting with dash?
|
||||||
idxs = [
|
idxs = [
|
||||||
@@ -378,8 +383,9 @@ class YoutubeDL(object):
|
|||||||
def add_info_extractor(self, ie):
|
def add_info_extractor(self, ie):
|
||||||
"""Add an InfoExtractor object to the end of the list."""
|
"""Add an InfoExtractor object to the end of the list."""
|
||||||
self._ies.append(ie)
|
self._ies.append(ie)
|
||||||
self._ies_instances[ie.ie_key()] = ie
|
if not isinstance(ie, type):
|
||||||
ie.set_downloader(self)
|
self._ies_instances[ie.ie_key()] = ie
|
||||||
|
ie.set_downloader(self)
|
||||||
|
|
||||||
def get_info_extractor(self, ie_key):
|
def get_info_extractor(self, ie_key):
|
||||||
"""
|
"""
|
||||||
@@ -397,7 +403,7 @@ class YoutubeDL(object):
|
|||||||
"""
|
"""
|
||||||
Add the InfoExtractors returned by gen_extractors to the end of the list
|
Add the InfoExtractors returned by gen_extractors to the end of the list
|
||||||
"""
|
"""
|
||||||
for ie in gen_extractors():
|
for ie in gen_extractor_classes():
|
||||||
self.add_info_extractor(ie)
|
self.add_info_extractor(ie)
|
||||||
|
|
||||||
def add_post_processor(self, pp):
|
def add_post_processor(self, pp):
|
||||||
@@ -577,7 +583,7 @@ class YoutubeDL(object):
|
|||||||
is_id=(k == 'id'))
|
is_id=(k == 'id'))
|
||||||
template_dict = dict((k, sanitize(k, v))
|
template_dict = dict((k, sanitize(k, v))
|
||||||
for k, v in template_dict.items()
|
for k, v in template_dict.items()
|
||||||
if v is not None)
|
if v is not None and not isinstance(v, (list, tuple, dict)))
|
||||||
template_dict = collections.defaultdict(lambda: 'NA', template_dict)
|
template_dict = collections.defaultdict(lambda: 'NA', template_dict)
|
||||||
|
|
||||||
outtmpl = self.params.get('outtmpl', DEFAULT_OUTTMPL)
|
outtmpl = self.params.get('outtmpl', DEFAULT_OUTTMPL)
|
||||||
@@ -661,6 +667,7 @@ class YoutubeDL(object):
|
|||||||
if not ie.suitable(url):
|
if not ie.suitable(url):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
ie = self.get_info_extractor(ie.ie_key())
|
||||||
if not ie.working():
|
if not ie.working():
|
||||||
self.report_warning('The program functionality for this site has been marked as broken, '
|
self.report_warning('The program functionality for this site has been marked as broken, '
|
||||||
'and will probably not work.')
|
'and will probably not work.')
|
||||||
@@ -713,6 +720,7 @@ class YoutubeDL(object):
|
|||||||
result_type = ie_result.get('_type', 'video')
|
result_type = ie_result.get('_type', 'video')
|
||||||
|
|
||||||
if result_type in ('url', 'url_transparent'):
|
if result_type in ('url', 'url_transparent'):
|
||||||
|
ie_result['url'] = sanitize_url(ie_result['url'])
|
||||||
extract_flat = self.params.get('extract_flat', False)
|
extract_flat = self.params.get('extract_flat', False)
|
||||||
if ((extract_flat == 'in_playlist' and 'playlist' in extra_info) or
|
if ((extract_flat == 'in_playlist' and 'playlist' in extra_info) or
|
||||||
extract_flat is True):
|
extract_flat is True):
|
||||||
@@ -1215,6 +1223,10 @@ class YoutubeDL(object):
|
|||||||
if 'title' not in info_dict:
|
if 'title' not in info_dict:
|
||||||
raise ExtractorError('Missing "title" field in extractor result')
|
raise ExtractorError('Missing "title" field in extractor result')
|
||||||
|
|
||||||
|
if not isinstance(info_dict['id'], compat_str):
|
||||||
|
self.report_warning('"id" field is not a string - forcing string conversion')
|
||||||
|
info_dict['id'] = compat_str(info_dict['id'])
|
||||||
|
|
||||||
if 'playlist' not in info_dict:
|
if 'playlist' not in info_dict:
|
||||||
# It isn't part of a playlist
|
# It isn't part of a playlist
|
||||||
info_dict['playlist'] = None
|
info_dict['playlist'] = None
|
||||||
@@ -1240,7 +1252,10 @@ class YoutubeDL(object):
|
|||||||
self.list_thumbnails(info_dict)
|
self.list_thumbnails(info_dict)
|
||||||
return
|
return
|
||||||
|
|
||||||
if thumbnails and 'thumbnail' not in info_dict:
|
thumbnail = info_dict.get('thumbnail')
|
||||||
|
if thumbnail:
|
||||||
|
info_dict['thumbnail'] = sanitize_url(thumbnail)
|
||||||
|
elif thumbnails:
|
||||||
info_dict['thumbnail'] = thumbnails[-1]['url']
|
info_dict['thumbnail'] = thumbnails[-1]['url']
|
||||||
|
|
||||||
if 'display_id' not in info_dict and 'id' in info_dict:
|
if 'display_id' not in info_dict and 'id' in info_dict:
|
||||||
@@ -1632,7 +1647,7 @@ class YoutubeDL(object):
|
|||||||
# Just a single file
|
# Just a single file
|
||||||
success = dl(filename, info_dict)
|
success = dl(filename, info_dict)
|
||||||
except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
|
except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
|
||||||
self.report_error('unable to download video data: %s' % str(err))
|
self.report_error('unable to download video data: %s' % error_to_compat_str(err))
|
||||||
return
|
return
|
||||||
except (OSError, IOError) as err:
|
except (OSError, IOError) as err:
|
||||||
raise UnavailableVideoError(err)
|
raise UnavailableVideoError(err)
|
||||||
@@ -1954,6 +1969,8 @@ class YoutubeDL(object):
|
|||||||
write_string(encoding_str, encoding=None)
|
write_string(encoding_str, encoding=None)
|
||||||
|
|
||||||
self._write_string('[debug] youtube-dl version ' + __version__ + '\n')
|
self._write_string('[debug] youtube-dl version ' + __version__ + '\n')
|
||||||
|
if _LAZY_LOADER:
|
||||||
|
self._write_string('[debug] Lazy loading extractors enabled' + '\n')
|
||||||
try:
|
try:
|
||||||
sp = subprocess.Popen(
|
sp = subprocess.Popen(
|
||||||
['git', 'rev-parse', '--short', 'HEAD'],
|
['git', 'rev-parse', '--short', 'HEAD'],
|
||||||
@@ -2009,6 +2026,7 @@ class YoutubeDL(object):
|
|||||||
if opts_cookiefile is None:
|
if opts_cookiefile is None:
|
||||||
self.cookiejar = compat_cookiejar.CookieJar()
|
self.cookiejar = compat_cookiejar.CookieJar()
|
||||||
else:
|
else:
|
||||||
|
opts_cookiefile = compat_expanduser(opts_cookiefile)
|
||||||
self.cookiejar = compat_cookiejar.MozillaCookieJar(
|
self.cookiejar = compat_cookiejar.MozillaCookieJar(
|
||||||
opts_cookiefile)
|
opts_cookiefile)
|
||||||
if os.access(opts_cookiefile, os.R_OK):
|
if os.access(opts_cookiefile, os.R_OK):
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ from .options import (
|
|||||||
from .compat import (
|
from .compat import (
|
||||||
compat_expanduser,
|
compat_expanduser,
|
||||||
compat_getpass,
|
compat_getpass,
|
||||||
compat_print,
|
|
||||||
compat_shlex_split,
|
compat_shlex_split,
|
||||||
workaround_optparse_bug9161,
|
workaround_optparse_bug9161,
|
||||||
)
|
)
|
||||||
@@ -67,16 +66,16 @@ def _real_main(argv=None):
|
|||||||
# Custom HTTP headers
|
# Custom HTTP headers
|
||||||
if opts.headers is not None:
|
if opts.headers is not None:
|
||||||
for h in opts.headers:
|
for h in opts.headers:
|
||||||
if h.find(':', 1) < 0:
|
if ':' not in h:
|
||||||
parser.error('wrong header formatting, it should be key:value, not "%s"' % h)
|
parser.error('wrong header formatting, it should be key:value, not "%s"' % h)
|
||||||
key, value = h.split(':', 2)
|
key, value = h.split(':', 1)
|
||||||
if opts.verbose:
|
if opts.verbose:
|
||||||
write_string('[debug] Adding header from command line option %s:%s\n' % (key, value))
|
write_string('[debug] Adding header from command line option %s:%s\n' % (key, value))
|
||||||
std_headers[key] = value
|
std_headers[key] = value
|
||||||
|
|
||||||
# Dump user agent
|
# Dump user agent
|
||||||
if opts.dump_user_agent:
|
if opts.dump_user_agent:
|
||||||
compat_print(std_headers['User-Agent'])
|
write_string(std_headers['User-Agent'] + '\n', out=sys.stdout)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
# Batch file verification
|
# Batch file verification
|
||||||
@@ -86,7 +85,9 @@ def _real_main(argv=None):
|
|||||||
if opts.batchfile == '-':
|
if opts.batchfile == '-':
|
||||||
batchfd = sys.stdin
|
batchfd = sys.stdin
|
||||||
else:
|
else:
|
||||||
batchfd = io.open(opts.batchfile, 'r', encoding='utf-8', errors='ignore')
|
batchfd = io.open(
|
||||||
|
compat_expanduser(opts.batchfile),
|
||||||
|
'r', encoding='utf-8', errors='ignore')
|
||||||
batch_urls = read_batch_urls(batchfd)
|
batch_urls = read_batch_urls(batchfd)
|
||||||
if opts.verbose:
|
if opts.verbose:
|
||||||
write_string('[debug] Batch file urls: ' + repr(batch_urls) + '\n')
|
write_string('[debug] Batch file urls: ' + repr(batch_urls) + '\n')
|
||||||
@@ -99,10 +100,10 @@ def _real_main(argv=None):
|
|||||||
|
|
||||||
if opts.list_extractors:
|
if opts.list_extractors:
|
||||||
for ie in list_extractors(opts.age_limit):
|
for ie in list_extractors(opts.age_limit):
|
||||||
compat_print(ie.IE_NAME + (' (CURRENTLY BROKEN)' if not ie._WORKING else ''))
|
write_string(ie.IE_NAME + (' (CURRENTLY BROKEN)' if not ie._WORKING else '') + '\n', out=sys.stdout)
|
||||||
matchedUrls = [url for url in all_urls if ie.suitable(url)]
|
matchedUrls = [url for url in all_urls if ie.suitable(url)]
|
||||||
for mu in matchedUrls:
|
for mu in matchedUrls:
|
||||||
compat_print(' ' + mu)
|
write_string(' ' + mu + '\n', out=sys.stdout)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
if opts.list_extractor_descriptions:
|
if opts.list_extractor_descriptions:
|
||||||
for ie in list_extractors(opts.age_limit):
|
for ie in list_extractors(opts.age_limit):
|
||||||
@@ -115,7 +116,7 @@ def _real_main(argv=None):
|
|||||||
_SEARCHES = ('cute kittens', 'slithering pythons', 'falling cat', 'angry poodle', 'purple fish', 'running tortoise', 'sleeping bunny', 'burping cow')
|
_SEARCHES = ('cute kittens', 'slithering pythons', 'falling cat', 'angry poodle', 'purple fish', 'running tortoise', 'sleeping bunny', 'burping cow')
|
||||||
_COUNTS = ('', '5', '10', 'all')
|
_COUNTS = ('', '5', '10', 'all')
|
||||||
desc += ' (Example: "%s%s:%s" )' % (ie.SEARCH_KEY, random.choice(_COUNTS), random.choice(_SEARCHES))
|
desc += ' (Example: "%s%s:%s" )' % (ie.SEARCH_KEY, random.choice(_COUNTS), random.choice(_SEARCHES))
|
||||||
compat_print(desc)
|
write_string(desc + '\n', out=sys.stdout)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
# Conflicting, missing and erroneous options
|
# Conflicting, missing and erroneous options
|
||||||
@@ -404,7 +405,7 @@ def _real_main(argv=None):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if opts.load_info_filename is not None:
|
if opts.load_info_filename is not None:
|
||||||
retcode = ydl.download_with_info_file(opts.load_info_filename)
|
retcode = ydl.download_with_info_file(compat_expanduser(opts.load_info_filename))
|
||||||
else:
|
else:
|
||||||
retcode = ydl.download(all_urls)
|
retcode = ydl.download(all_urls)
|
||||||
except MaxDownloadsReached:
|
except MaxDownloadsReached:
|
||||||
|
|||||||
2315
youtube_dl/compat.py
2315
youtube_dl/compat.py
File diff suppressed because it is too large
Load Diff
@@ -41,9 +41,12 @@ def get_suitable_downloader(info_dict, params={}):
|
|||||||
if ed.can_download(info_dict):
|
if ed.can_download(info_dict):
|
||||||
return ed
|
return ed
|
||||||
|
|
||||||
if protocol == 'm3u8' and params.get('hls_prefer_native'):
|
if protocol == 'm3u8' and params.get('hls_prefer_native') is True:
|
||||||
return HlsFD
|
return HlsFD
|
||||||
|
|
||||||
|
if protocol == 'm3u8_native' and params.get('hls_prefer_native') is False:
|
||||||
|
return FFmpegFD
|
||||||
|
|
||||||
return PROTOCOL_MAP.get(protocol, HttpFD)
|
return PROTOCOL_MAP.get(protocol, HttpFD)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import sys
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from .common import FileDownloader
|
from .common import FileDownloader
|
||||||
|
from ..compat import compat_setenv
|
||||||
from ..postprocessor.ffmpeg import FFmpegPostProcessor, EXT_TO_OUT_FORMATS
|
from ..postprocessor.ffmpeg import FFmpegPostProcessor, EXT_TO_OUT_FORMATS
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
cli_option,
|
cli_option,
|
||||||
@@ -84,7 +85,7 @@ class ExternalFD(FileDownloader):
|
|||||||
cmd, stderr=subprocess.PIPE)
|
cmd, stderr=subprocess.PIPE)
|
||||||
_, stderr = p.communicate()
|
_, stderr = p.communicate()
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
self.to_stderr(stderr)
|
self.to_stderr(stderr.decode('utf-8', 'replace'))
|
||||||
return p.returncode
|
return p.returncode
|
||||||
|
|
||||||
|
|
||||||
@@ -198,6 +199,19 @@ class FFmpegFD(ExternalFD):
|
|||||||
'-headers',
|
'-headers',
|
||||||
''.join('%s: %s\r\n' % (key, val) for key, val in headers.items())]
|
''.join('%s: %s\r\n' % (key, val) for key, val in headers.items())]
|
||||||
|
|
||||||
|
env = None
|
||||||
|
proxy = self.params.get('proxy')
|
||||||
|
if proxy:
|
||||||
|
if not re.match(r'^[\da-zA-Z]+://', proxy):
|
||||||
|
proxy = 'http://%s' % proxy
|
||||||
|
# Since December 2015 ffmpeg supports -http_proxy option (see
|
||||||
|
# http://git.videolan.org/?p=ffmpeg.git;a=commit;h=b4eb1f29ebddd60c41a2eb39f5af701e38e0d3fd)
|
||||||
|
# We could switch to the following code if we are able to detect version properly
|
||||||
|
# args += ['-http_proxy', proxy]
|
||||||
|
env = os.environ.copy()
|
||||||
|
compat_setenv('HTTP_PROXY', proxy, env=env)
|
||||||
|
compat_setenv('http_proxy', proxy, env=env)
|
||||||
|
|
||||||
protocol = info_dict.get('protocol')
|
protocol = info_dict.get('protocol')
|
||||||
|
|
||||||
if protocol == 'rtmp':
|
if protocol == 'rtmp':
|
||||||
@@ -224,8 +238,8 @@ class FFmpegFD(ExternalFD):
|
|||||||
args += ['-rtmp_live', 'live']
|
args += ['-rtmp_live', 'live']
|
||||||
|
|
||||||
args += ['-i', url, '-c', 'copy']
|
args += ['-i', url, '-c', 'copy']
|
||||||
if protocol == 'm3u8':
|
if protocol in ('m3u8', 'm3u8_native'):
|
||||||
if self.params.get('hls_use_mpegts', False):
|
if self.params.get('hls_use_mpegts', False) or tmpfilename == '-':
|
||||||
args += ['-f', 'mpegts']
|
args += ['-f', 'mpegts']
|
||||||
else:
|
else:
|
||||||
args += ['-f', 'mp4', '-bsf:a', 'aac_adtstoasc']
|
args += ['-f', 'mp4', '-bsf:a', 'aac_adtstoasc']
|
||||||
@@ -239,7 +253,7 @@ class FFmpegFD(ExternalFD):
|
|||||||
|
|
||||||
self._debug_cmd(args)
|
self._debug_cmd(args)
|
||||||
|
|
||||||
proc = subprocess.Popen(args, stdin=subprocess.PIPE)
|
proc = subprocess.Popen(args, stdin=subprocess.PIPE, env=env)
|
||||||
try:
|
try:
|
||||||
retval = proc.wait()
|
retval = proc.wait()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|||||||
@@ -12,37 +12,49 @@ from ..compat import (
|
|||||||
compat_urlparse,
|
compat_urlparse,
|
||||||
compat_urllib_error,
|
compat_urllib_error,
|
||||||
compat_urllib_parse_urlparse,
|
compat_urllib_parse_urlparse,
|
||||||
|
compat_struct_pack,
|
||||||
|
compat_struct_unpack,
|
||||||
)
|
)
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
encodeFilename,
|
encodeFilename,
|
||||||
fix_xml_ampersands,
|
fix_xml_ampersands,
|
||||||
sanitize_open,
|
sanitize_open,
|
||||||
struct_pack,
|
|
||||||
struct_unpack,
|
|
||||||
xpath_text,
|
xpath_text,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class DataTruncatedError(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class FlvReader(io.BytesIO):
|
class FlvReader(io.BytesIO):
|
||||||
"""
|
"""
|
||||||
Reader for Flv files
|
Reader for Flv files
|
||||||
The file format is documented in https://www.adobe.com/devnet/f4v.html
|
The file format is documented in https://www.adobe.com/devnet/f4v.html
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def read_bytes(self, n):
|
||||||
|
data = self.read(n)
|
||||||
|
if len(data) < n:
|
||||||
|
raise DataTruncatedError(
|
||||||
|
'FlvReader error: need %d bytes while only %d bytes got' % (
|
||||||
|
n, len(data)))
|
||||||
|
return data
|
||||||
|
|
||||||
# Utility functions for reading numbers and strings
|
# Utility functions for reading numbers and strings
|
||||||
def read_unsigned_long_long(self):
|
def read_unsigned_long_long(self):
|
||||||
return struct_unpack('!Q', self.read(8))[0]
|
return compat_struct_unpack('!Q', self.read_bytes(8))[0]
|
||||||
|
|
||||||
def read_unsigned_int(self):
|
def read_unsigned_int(self):
|
||||||
return struct_unpack('!I', self.read(4))[0]
|
return compat_struct_unpack('!I', self.read_bytes(4))[0]
|
||||||
|
|
||||||
def read_unsigned_char(self):
|
def read_unsigned_char(self):
|
||||||
return struct_unpack('!B', self.read(1))[0]
|
return compat_struct_unpack('!B', self.read_bytes(1))[0]
|
||||||
|
|
||||||
def read_string(self):
|
def read_string(self):
|
||||||
res = b''
|
res = b''
|
||||||
while True:
|
while True:
|
||||||
char = self.read(1)
|
char = self.read_bytes(1)
|
||||||
if char == b'\x00':
|
if char == b'\x00':
|
||||||
break
|
break
|
||||||
res += char
|
res += char
|
||||||
@@ -53,18 +65,18 @@ class FlvReader(io.BytesIO):
|
|||||||
Read a box and return the info as a tuple: (box_size, box_type, box_data)
|
Read a box and return the info as a tuple: (box_size, box_type, box_data)
|
||||||
"""
|
"""
|
||||||
real_size = size = self.read_unsigned_int()
|
real_size = size = self.read_unsigned_int()
|
||||||
box_type = self.read(4)
|
box_type = self.read_bytes(4)
|
||||||
header_end = 8
|
header_end = 8
|
||||||
if size == 1:
|
if size == 1:
|
||||||
real_size = self.read_unsigned_long_long()
|
real_size = self.read_unsigned_long_long()
|
||||||
header_end = 16
|
header_end = 16
|
||||||
return real_size, box_type, self.read(real_size - header_end)
|
return real_size, box_type, self.read_bytes(real_size - header_end)
|
||||||
|
|
||||||
def read_asrt(self):
|
def read_asrt(self):
|
||||||
# version
|
# version
|
||||||
self.read_unsigned_char()
|
self.read_unsigned_char()
|
||||||
# flags
|
# flags
|
||||||
self.read(3)
|
self.read_bytes(3)
|
||||||
quality_entry_count = self.read_unsigned_char()
|
quality_entry_count = self.read_unsigned_char()
|
||||||
# QualityEntryCount
|
# QualityEntryCount
|
||||||
for i in range(quality_entry_count):
|
for i in range(quality_entry_count):
|
||||||
@@ -85,7 +97,7 @@ class FlvReader(io.BytesIO):
|
|||||||
# version
|
# version
|
||||||
self.read_unsigned_char()
|
self.read_unsigned_char()
|
||||||
# flags
|
# flags
|
||||||
self.read(3)
|
self.read_bytes(3)
|
||||||
# time scale
|
# time scale
|
||||||
self.read_unsigned_int()
|
self.read_unsigned_int()
|
||||||
|
|
||||||
@@ -119,7 +131,7 @@ class FlvReader(io.BytesIO):
|
|||||||
# version
|
# version
|
||||||
self.read_unsigned_char()
|
self.read_unsigned_char()
|
||||||
# flags
|
# flags
|
||||||
self.read(3)
|
self.read_bytes(3)
|
||||||
|
|
||||||
self.read_unsigned_int() # BootstrapinfoVersion
|
self.read_unsigned_int() # BootstrapinfoVersion
|
||||||
# Profile,Live,Update,Reserved
|
# Profile,Live,Update,Reserved
|
||||||
@@ -194,11 +206,11 @@ def build_fragments_list(boot_info):
|
|||||||
|
|
||||||
|
|
||||||
def write_unsigned_int(stream, val):
|
def write_unsigned_int(stream, val):
|
||||||
stream.write(struct_pack('!I', val))
|
stream.write(compat_struct_pack('!I', val))
|
||||||
|
|
||||||
|
|
||||||
def write_unsigned_int_24(stream, val):
|
def write_unsigned_int_24(stream, val):
|
||||||
stream.write(struct_pack('!I', val)[1:])
|
stream.write(compat_struct_pack('!I', val)[1:])
|
||||||
|
|
||||||
|
|
||||||
def write_flv_header(stream):
|
def write_flv_header(stream):
|
||||||
@@ -307,7 +319,7 @@ class F4mFD(FragmentFD):
|
|||||||
doc = compat_etree_fromstring(manifest)
|
doc = compat_etree_fromstring(manifest)
|
||||||
formats = [(int(f.attrib.get('bitrate', -1)), f)
|
formats = [(int(f.attrib.get('bitrate', -1)), f)
|
||||||
for f in self._get_unencrypted_media(doc)]
|
for f in self._get_unencrypted_media(doc)]
|
||||||
if requested_bitrate is None:
|
if requested_bitrate is None or len(formats) == 1:
|
||||||
# get the best format
|
# get the best format
|
||||||
formats = sorted(formats, key=lambda f: f[0])
|
formats = sorted(formats, key=lambda f: f[0])
|
||||||
rate, media = formats[-1]
|
rate, media = formats[-1]
|
||||||
@@ -374,7 +386,17 @@ class F4mFD(FragmentFD):
|
|||||||
down.close()
|
down.close()
|
||||||
reader = FlvReader(down_data)
|
reader = FlvReader(down_data)
|
||||||
while True:
|
while True:
|
||||||
_, box_type, box_data = reader.read_box_info()
|
try:
|
||||||
|
_, box_type, box_data = reader.read_box_info()
|
||||||
|
except DataTruncatedError:
|
||||||
|
if test:
|
||||||
|
# In tests, segments may be truncated, and thus
|
||||||
|
# FlvReader may not be able to parse the whole
|
||||||
|
# chunk. If so, write the segment as is
|
||||||
|
# See https://github.com/rg3/youtube-dl/issues/9214
|
||||||
|
dest_stream.write(down_data)
|
||||||
|
break
|
||||||
|
raise
|
||||||
if box_type == b'mdat':
|
if box_type == b'mdat':
|
||||||
dest_stream.write(box_data)
|
dest_stream.write(box_data)
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -2,13 +2,24 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
import re
|
import re
|
||||||
|
import binascii
|
||||||
|
try:
|
||||||
|
from Crypto.Cipher import AES
|
||||||
|
can_decrypt_frag = True
|
||||||
|
except ImportError:
|
||||||
|
can_decrypt_frag = False
|
||||||
|
|
||||||
from .fragment import FragmentFD
|
from .fragment import FragmentFD
|
||||||
|
from .external import FFmpegFD
|
||||||
|
|
||||||
from ..compat import compat_urlparse
|
from ..compat import (
|
||||||
|
compat_urlparse,
|
||||||
|
compat_struct_pack,
|
||||||
|
)
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
encodeFilename,
|
encodeFilename,
|
||||||
sanitize_open,
|
sanitize_open,
|
||||||
|
parse_m3u8_attributes,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -17,42 +28,101 @@ class HlsFD(FragmentFD):
|
|||||||
|
|
||||||
FD_NAME = 'hlsnative'
|
FD_NAME = 'hlsnative'
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def can_download(manifest):
|
||||||
|
UNSUPPORTED_FEATURES = (
|
||||||
|
r'#EXT-X-KEY:METHOD=(?!NONE|AES-128)', # encrypted streams [1]
|
||||||
|
r'#EXT-X-BYTERANGE', # playlists composed of byte ranges of media files [2]
|
||||||
|
|
||||||
|
# Live streams heuristic does not always work (e.g. geo restricted to Germany
|
||||||
|
# http://hls-geo.daserste.de/i/videoportal/Film/c_620000/622873/format,716451,716457,716450,716458,716459,.mp4.csmil/index_4_av.m3u8?null=0)
|
||||||
|
# r'#EXT-X-MEDIA-SEQUENCE:(?!0$)', # live streams [3]
|
||||||
|
|
||||||
|
# This heuristic also is not correct since segments may not be appended as well.
|
||||||
|
# Twitch vods of finished streams have EXT-X-PLAYLIST-TYPE:EVENT despite
|
||||||
|
# no segments will definitely be appended to the end of the playlist.
|
||||||
|
# r'#EXT-X-PLAYLIST-TYPE:EVENT', # media segments may be appended to the end of
|
||||||
|
# # event media playlists [4]
|
||||||
|
|
||||||
|
# 1. https://tools.ietf.org/html/draft-pantos-http-live-streaming-17#section-4.3.2.4
|
||||||
|
# 2. https://tools.ietf.org/html/draft-pantos-http-live-streaming-17#section-4.3.2.2
|
||||||
|
# 3. https://tools.ietf.org/html/draft-pantos-http-live-streaming-17#section-4.3.3.2
|
||||||
|
# 4. https://tools.ietf.org/html/draft-pantos-http-live-streaming-17#section-4.3.3.5
|
||||||
|
)
|
||||||
|
check_results = [not re.search(feature, manifest) for feature in UNSUPPORTED_FEATURES]
|
||||||
|
check_results.append(can_decrypt_frag or '#EXT-X-KEY:METHOD=AES-128' not in manifest)
|
||||||
|
return all(check_results)
|
||||||
|
|
||||||
def real_download(self, filename, info_dict):
|
def real_download(self, filename, info_dict):
|
||||||
man_url = info_dict['url']
|
man_url = info_dict['url']
|
||||||
self.to_screen('[%s] Downloading m3u8 manifest' % self.FD_NAME)
|
self.to_screen('[%s] Downloading m3u8 manifest' % self.FD_NAME)
|
||||||
manifest = self.ydl.urlopen(man_url).read()
|
manifest = self.ydl.urlopen(man_url).read()
|
||||||
|
|
||||||
s = manifest.decode('utf-8', 'ignore')
|
s = manifest.decode('utf-8', 'ignore')
|
||||||
fragment_urls = []
|
|
||||||
|
if not self.can_download(s):
|
||||||
|
self.report_warning(
|
||||||
|
'hlsnative has detected features it does not support, '
|
||||||
|
'extraction will be delegated to ffmpeg')
|
||||||
|
fd = FFmpegFD(self.ydl, self.params)
|
||||||
|
for ph in self._progress_hooks:
|
||||||
|
fd.add_progress_hook(ph)
|
||||||
|
return fd.real_download(filename, info_dict)
|
||||||
|
|
||||||
|
total_frags = 0
|
||||||
for line in s.splitlines():
|
for line in s.splitlines():
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if line and not line.startswith('#'):
|
if line and not line.startswith('#'):
|
||||||
segment_url = (
|
total_frags += 1
|
||||||
line
|
|
||||||
if re.match(r'^https?://', line)
|
|
||||||
else compat_urlparse.urljoin(man_url, line))
|
|
||||||
fragment_urls.append(segment_url)
|
|
||||||
# We only download the first fragment during the test
|
|
||||||
if self.params.get('test', False):
|
|
||||||
break
|
|
||||||
|
|
||||||
ctx = {
|
ctx = {
|
||||||
'filename': filename,
|
'filename': filename,
|
||||||
'total_frags': len(fragment_urls),
|
'total_frags': total_frags,
|
||||||
}
|
}
|
||||||
|
|
||||||
self._prepare_and_start_frag_download(ctx)
|
self._prepare_and_start_frag_download(ctx)
|
||||||
|
|
||||||
|
i = 0
|
||||||
|
media_sequence = 0
|
||||||
|
decrypt_info = {'METHOD': 'NONE'}
|
||||||
frags_filenames = []
|
frags_filenames = []
|
||||||
for i, frag_url in enumerate(fragment_urls):
|
for line in s.splitlines():
|
||||||
frag_filename = '%s-Frag%d' % (ctx['tmpfilename'], i)
|
line = line.strip()
|
||||||
success = ctx['dl'].download(frag_filename, {'url': frag_url})
|
if line:
|
||||||
if not success:
|
if not line.startswith('#'):
|
||||||
return False
|
frag_url = (
|
||||||
down, frag_sanitized = sanitize_open(frag_filename, 'rb')
|
line
|
||||||
ctx['dest_stream'].write(down.read())
|
if re.match(r'^https?://', line)
|
||||||
down.close()
|
else compat_urlparse.urljoin(man_url, line))
|
||||||
frags_filenames.append(frag_sanitized)
|
frag_filename = '%s-Frag%d' % (ctx['tmpfilename'], i)
|
||||||
|
success = ctx['dl'].download(frag_filename, {'url': frag_url})
|
||||||
|
if not success:
|
||||||
|
return False
|
||||||
|
down, frag_sanitized = sanitize_open(frag_filename, 'rb')
|
||||||
|
frag_content = down.read()
|
||||||
|
down.close()
|
||||||
|
if decrypt_info['METHOD'] == 'AES-128':
|
||||||
|
iv = decrypt_info.get('IV') or compat_struct_pack('>8xq', media_sequence)
|
||||||
|
frag_content = AES.new(
|
||||||
|
decrypt_info['KEY'], AES.MODE_CBC, iv).decrypt(frag_content)
|
||||||
|
ctx['dest_stream'].write(frag_content)
|
||||||
|
frags_filenames.append(frag_sanitized)
|
||||||
|
# We only download the first fragment during the test
|
||||||
|
if self.params.get('test', False):
|
||||||
|
break
|
||||||
|
i += 1
|
||||||
|
media_sequence += 1
|
||||||
|
elif line.startswith('#EXT-X-KEY'):
|
||||||
|
decrypt_info = parse_m3u8_attributes(line[11:])
|
||||||
|
if decrypt_info['METHOD'] == 'AES-128':
|
||||||
|
if 'IV' in decrypt_info:
|
||||||
|
decrypt_info['IV'] = binascii.unhexlify(decrypt_info['IV'][2:])
|
||||||
|
if not re.match(r'^https?://', decrypt_info['URI']):
|
||||||
|
decrypt_info['URI'] = compat_urlparse.urljoin(
|
||||||
|
man_url, decrypt_info['URI'])
|
||||||
|
decrypt_info['KEY'] = self.ydl.urlopen(decrypt_info['URI']).read()
|
||||||
|
elif line.startswith('#EXT-X-MEDIA-SEQUENCE'):
|
||||||
|
media_sequence = int(line[22:])
|
||||||
|
|
||||||
self._finish_frag_download(ctx)
|
self._finish_frag_download(ctx)
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ class RtspFD(FileDownloader):
|
|||||||
self.report_error('MMS or RTSP download detected but neither "mplayer" nor "mpv" could be run. Please install any.')
|
self.report_error('MMS or RTSP download detected but neither "mplayer" nor "mpv" could be run. Please install any.')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
self._debug_cmd(args)
|
||||||
|
|
||||||
retval = subprocess.call(args)
|
retval = subprocess.call(args)
|
||||||
if retval == 0:
|
if retval == 0:
|
||||||
fsize = os.path.getsize(encodeFilename(tmpfilename))
|
fsize = os.path.getsize(encodeFilename(tmpfilename))
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
135
youtube_dl/extractor/abcnews.py
Normal file
135
youtube_dl/extractor/abcnews.py
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import calendar
|
||||||
|
import re
|
||||||
|
import time
|
||||||
|
|
||||||
|
from .amp import AMPIE
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..compat import compat_urlparse
|
||||||
|
|
||||||
|
|
||||||
|
class AbcNewsVideoIE(AMPIE):
|
||||||
|
IE_NAME = 'abcnews:video'
|
||||||
|
_VALID_URL = 'http://abcnews.go.com/[^/]+/video/(?P<display_id>[0-9a-z-]+)-(?P<id>\d+)'
|
||||||
|
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://abcnews.go.com/ThisWeek/video/week-exclusive-irans-foreign-minister-zarif-20411932',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '20411932',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'display_id': 'week-exclusive-irans-foreign-minister-zarif',
|
||||||
|
'title': '\'This Week\' Exclusive: Iran\'s Foreign Minister Zarif',
|
||||||
|
'description': 'George Stephanopoulos goes one-on-one with Iranian Foreign Minister Dr. Javad Zarif.',
|
||||||
|
'duration': 180,
|
||||||
|
'thumbnail': 're:^https?://.*\.jpg$',
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
# m3u8 download
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'url': 'http://abcnews.go.com/2020/video/2020-husband-stands-teacher-jail-student-affairs-26119478',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
display_id = mobj.group('display_id')
|
||||||
|
video_id = mobj.group('id')
|
||||||
|
info_dict = self._extract_feed_info(
|
||||||
|
'http://abcnews.go.com/video/itemfeed?id=%s' % video_id)
|
||||||
|
info_dict.update({
|
||||||
|
'id': video_id,
|
||||||
|
'display_id': display_id,
|
||||||
|
})
|
||||||
|
return info_dict
|
||||||
|
|
||||||
|
|
||||||
|
class AbcNewsIE(InfoExtractor):
|
||||||
|
IE_NAME = 'abcnews'
|
||||||
|
_VALID_URL = 'https?://abcnews\.go\.com/(?:[^/]+/)+(?P<display_id>[0-9a-z-]+)/story\?id=(?P<id>\d+)'
|
||||||
|
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://abcnews.go.com/Blotter/News/dramatic-video-rare-death-job-america/story?id=10498713#.UIhwosWHLjY',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '10498713',
|
||||||
|
'ext': 'flv',
|
||||||
|
'display_id': 'dramatic-video-rare-death-job-america',
|
||||||
|
'title': 'Occupational Hazards',
|
||||||
|
'description': 'Nightline investigates the dangers that lurk at various jobs.',
|
||||||
|
'thumbnail': 're:^https?://.*\.jpg$',
|
||||||
|
'upload_date': '20100428',
|
||||||
|
'timestamp': 1272412800,
|
||||||
|
},
|
||||||
|
'add_ie': ['AbcNewsVideo'],
|
||||||
|
}, {
|
||||||
|
'url': 'http://abcnews.go.com/Entertainment/justin-timberlake-performs-stop-feeling-eurovision-2016/story?id=39125818',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '39125818',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'display_id': 'justin-timberlake-performs-stop-feeling-eurovision-2016',
|
||||||
|
'title': 'Justin Timberlake Drops Hints For Secret Single',
|
||||||
|
'description': 'Lara Spencer reports the buzziest stories of the day in "GMA" Pop News.',
|
||||||
|
'upload_date': '20160515',
|
||||||
|
'timestamp': 1463329500,
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
# m3u8 download
|
||||||
|
'skip_download': True,
|
||||||
|
# The embedded YouTube video is blocked due to copyright issues
|
||||||
|
'playlist_items': '1',
|
||||||
|
},
|
||||||
|
'add_ie': ['AbcNewsVideo'],
|
||||||
|
}, {
|
||||||
|
'url': 'http://abcnews.go.com/Technology/exclusive-apple-ceo-tim-cook-iphone-cracking-software/story?id=37173343',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
display_id = mobj.group('display_id')
|
||||||
|
video_id = mobj.group('id')
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
video_url = self._search_regex(
|
||||||
|
r'window\.abcnvideo\.url\s*=\s*"([^"]+)"', webpage, 'video URL')
|
||||||
|
full_video_url = compat_urlparse.urljoin(url, video_url)
|
||||||
|
|
||||||
|
youtube_url = self._html_search_regex(
|
||||||
|
r'<iframe[^>]+src="(https://www\.youtube\.com/embed/[^"]+)"',
|
||||||
|
webpage, 'YouTube URL', default=None)
|
||||||
|
|
||||||
|
timestamp = None
|
||||||
|
date_str = self._html_search_regex(
|
||||||
|
r'<span[^>]+class="timestamp">([^<]+)</span>',
|
||||||
|
webpage, 'timestamp', fatal=False)
|
||||||
|
if date_str:
|
||||||
|
tz_offset = 0
|
||||||
|
if date_str.endswith(' ET'): # Eastern Time
|
||||||
|
tz_offset = -5
|
||||||
|
date_str = date_str[:-3]
|
||||||
|
date_formats = ['%b. %d, %Y', '%b %d, %Y, %I:%M %p']
|
||||||
|
for date_format in date_formats:
|
||||||
|
try:
|
||||||
|
timestamp = calendar.timegm(time.strptime(date_str.strip(), date_format))
|
||||||
|
except ValueError:
|
||||||
|
continue
|
||||||
|
if timestamp is not None:
|
||||||
|
timestamp -= tz_offset * 3600
|
||||||
|
|
||||||
|
entry = {
|
||||||
|
'_type': 'url_transparent',
|
||||||
|
'ie_key': AbcNewsVideoIE.ie_key(),
|
||||||
|
'url': full_video_url,
|
||||||
|
'id': video_id,
|
||||||
|
'display_id': display_id,
|
||||||
|
'timestamp': timestamp,
|
||||||
|
}
|
||||||
|
|
||||||
|
if youtube_url:
|
||||||
|
entries = [entry, self.url_result(youtube_url, 'Youtube')]
|
||||||
|
return self.playlist_result(entries)
|
||||||
|
|
||||||
|
return entry
|
||||||
@@ -2,10 +2,14 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import functools
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import compat_str
|
from ..compat import compat_str
|
||||||
from ..utils import int_or_none
|
from ..utils import (
|
||||||
|
int_or_none,
|
||||||
|
OnDemandPagedList,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ACastIE(InfoExtractor):
|
class ACastIE(InfoExtractor):
|
||||||
@@ -26,13 +30,8 @@ class ACastIE(InfoExtractor):
|
|||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
channel, display_id = re.match(self._VALID_URL, url).groups()
|
channel, display_id = re.match(self._VALID_URL, url).groups()
|
||||||
|
cast_data = self._download_json(
|
||||||
embed_page = self._download_webpage(
|
'https://embed.acast.com/api/acasts/%s/%s' % (channel, display_id), display_id)
|
||||||
re.sub('(?:www\.)?acast\.com', 'embedcdn.acast.com', url), display_id)
|
|
||||||
cast_data = self._parse_json(self._search_regex(
|
|
||||||
r'window\[\'acast/queries\'\]\s*=\s*([^;]+);', embed_page, 'acast data'),
|
|
||||||
display_id)['GetAcast/%s/%s' % (channel, display_id)]
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': compat_str(cast_data['id']),
|
'id': compat_str(cast_data['id']),
|
||||||
'display_id': display_id,
|
'display_id': display_id,
|
||||||
@@ -58,15 +57,26 @@ class ACastChannelIE(InfoExtractor):
|
|||||||
'playlist_mincount': 20,
|
'playlist_mincount': 20,
|
||||||
}
|
}
|
||||||
_API_BASE_URL = 'https://www.acast.com/api/'
|
_API_BASE_URL = 'https://www.acast.com/api/'
|
||||||
|
_PAGE_SIZE = 10
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def suitable(cls, url):
|
def suitable(cls, url):
|
||||||
return False if ACastIE.suitable(url) else super(ACastChannelIE, cls).suitable(url)
|
return False if ACastIE.suitable(url) else super(ACastChannelIE, cls).suitable(url)
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _fetch_page(self, channel_slug, page):
|
||||||
display_id = self._match_id(url)
|
casts = self._download_json(
|
||||||
channel_data = self._download_json(self._API_BASE_URL + 'channels/%s' % display_id, display_id)
|
self._API_BASE_URL + 'channels/%s/acasts?page=%s' % (channel_slug, page),
|
||||||
casts = self._download_json(self._API_BASE_URL + 'channels/%s/acasts' % display_id, display_id)
|
channel_slug, note='Download page %d of channel data' % page)
|
||||||
entries = [self.url_result('https://www.acast.com/%s/%s' % (display_id, cast['url']), 'ACast') for cast in casts]
|
for cast in casts:
|
||||||
|
yield self.url_result(
|
||||||
|
'https://www.acast.com/%s/%s' % (channel_slug, cast['url']),
|
||||||
|
'ACast', cast['id'])
|
||||||
|
|
||||||
return self.playlist_result(entries, compat_str(channel_data['id']), channel_data['name'], channel_data.get('description'))
|
def _real_extract(self, url):
|
||||||
|
channel_slug = self._match_id(url)
|
||||||
|
channel_data = self._download_json(
|
||||||
|
self._API_BASE_URL + 'channels/%s' % channel_slug, channel_slug)
|
||||||
|
entries = OnDemandPagedList(functools.partial(
|
||||||
|
self._fetch_page, channel_slug), self._PAGE_SIZE)
|
||||||
|
return self.playlist_result(entries, compat_str(
|
||||||
|
channel_data['id']), channel_data['name'], channel_data.get('description'))
|
||||||
|
|||||||
@@ -156,7 +156,10 @@ class AdobeTVVideoIE(InfoExtractor):
|
|||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
video_data = self._download_json(url + '?format=json', video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
|
video_data = self._parse_json(self._search_regex(
|
||||||
|
r'var\s+bridge\s*=\s*([^;]+);', webpage, 'bridged data'), video_id)
|
||||||
|
|
||||||
formats = [{
|
formats = [{
|
||||||
'format_id': '%s-%s' % (determine_ext(source['src']), source.get('height')),
|
'format_id': '%s-%s' % (determine_ext(source['src']), source.get('height')),
|
||||||
|
|||||||
@@ -7,18 +7,123 @@ from ..utils import (
|
|||||||
smuggle_url,
|
smuggle_url,
|
||||||
update_url_query,
|
update_url_query,
|
||||||
unescapeHTML,
|
unescapeHTML,
|
||||||
|
extract_attributes,
|
||||||
|
get_element_by_attribute,
|
||||||
|
)
|
||||||
|
from ..compat import (
|
||||||
|
compat_urlparse,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class AENetworksIE(InfoExtractor):
|
class AENetworksBaseIE(InfoExtractor):
|
||||||
|
def theplatform_url_result(self, theplatform_url, video_id, query):
|
||||||
|
return {
|
||||||
|
'_type': 'url_transparent',
|
||||||
|
'id': video_id,
|
||||||
|
'url': smuggle_url(
|
||||||
|
update_url_query(theplatform_url, query),
|
||||||
|
{
|
||||||
|
'sig': {
|
||||||
|
'key': 'crazyjava',
|
||||||
|
'secret': 's3cr3t'
|
||||||
|
},
|
||||||
|
'force_smil_url': True
|
||||||
|
}),
|
||||||
|
'ie_key': 'ThePlatform',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class AENetworksIE(AENetworksBaseIE):
|
||||||
IE_NAME = 'aenetworks'
|
IE_NAME = 'aenetworks'
|
||||||
IE_DESC = 'A+E Networks: A&E, Lifetime, History.com, FYI Network'
|
IE_DESC = 'A+E Networks: A&E, Lifetime, History.com, FYI Network'
|
||||||
_VALID_URL = r'https?://(?:www\.)?(?:(?:history|aetv|mylifetime)\.com|fyi\.tv)/(?P<type>[^/]+)/(?:[^/]+/)+(?P<id>[^/]+?)(?:$|[?#])'
|
_VALID_URL = r'https?://(?:www\.)?(?:(?:history|aetv|mylifetime)\.com|fyi\.tv)/(?:shows/(?P<show_path>[^/]+(?:/[^/]+){0,2})|movies/(?P<movie_display_id>[^/]+)/full-movie)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://www.history.com/shows/mountain-men/season-1/episode-1',
|
||||||
|
'md5': '8ff93eb073449f151d6b90c0ae1ef0c7',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '22253814',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Winter Is Coming',
|
||||||
|
'description': 'md5:641f424b7a19d8e24f26dea22cf59d74',
|
||||||
|
'timestamp': 1338306241,
|
||||||
|
'upload_date': '20120529',
|
||||||
|
'uploader': 'AENE-NEW',
|
||||||
|
},
|
||||||
|
'add_ie': ['ThePlatform'],
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.history.com/shows/ancient-aliens/season-1',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '71889446852',
|
||||||
|
},
|
||||||
|
'playlist_mincount': 5,
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.mylifetime.com/shows/atlanta-plastic',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'SERIES4317',
|
||||||
|
'title': 'Atlanta Plastic',
|
||||||
|
},
|
||||||
|
'playlist_mincount': 2,
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.aetv.com/shows/duck-dynasty/season-9/episode-1',
|
||||||
|
'only_matching': True
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.fyi.tv/shows/tiny-house-nation/season-1/episode-8',
|
||||||
|
'only_matching': True
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.mylifetime.com/shows/project-runway-junior/season-1/episode-6',
|
||||||
|
'only_matching': True
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.mylifetime.com/movies/center-stage-on-pointe/full-movie',
|
||||||
|
'only_matching': True
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
show_path, movie_display_id = re.match(self._VALID_URL, url).groups()
|
||||||
|
display_id = show_path or movie_display_id
|
||||||
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
if show_path:
|
||||||
|
url_parts = show_path.split('/')
|
||||||
|
url_parts_len = len(url_parts)
|
||||||
|
if url_parts_len == 1:
|
||||||
|
entries = []
|
||||||
|
for season_url_path in re.findall(r'(?s)<li[^>]+data-href="(/shows/%s/season-\d+)"' % url_parts[0], webpage):
|
||||||
|
entries.append(self.url_result(
|
||||||
|
compat_urlparse.urljoin(url, season_url_path), 'AENetworks'))
|
||||||
|
return self.playlist_result(
|
||||||
|
entries, self._html_search_meta('aetn:SeriesId', webpage),
|
||||||
|
self._html_search_meta('aetn:SeriesTitle', webpage))
|
||||||
|
elif url_parts_len == 2:
|
||||||
|
entries = []
|
||||||
|
for episode_item in re.findall(r'(?s)<div[^>]+class="[^"]*episode-item[^"]*"[^>]*>', webpage):
|
||||||
|
episode_attributes = extract_attributes(episode_item)
|
||||||
|
episode_url = compat_urlparse.urljoin(
|
||||||
|
url, episode_attributes['data-canonical'])
|
||||||
|
entries.append(self.url_result(
|
||||||
|
episode_url, 'AENetworks',
|
||||||
|
episode_attributes['data-videoid']))
|
||||||
|
return self.playlist_result(
|
||||||
|
entries, self._html_search_meta('aetn:SeasonId', webpage))
|
||||||
|
video_id = self._html_search_meta('aetn:VideoID', webpage)
|
||||||
|
media_url = self._search_regex(
|
||||||
|
r"media_url\s*=\s*'([^']+)'", webpage, 'video url')
|
||||||
|
|
||||||
|
info = self._search_json_ld(webpage, video_id, fatal=False)
|
||||||
|
info.update(self.theplatform_url_result(
|
||||||
|
media_url, video_id, {
|
||||||
|
'mbr': 'true',
|
||||||
|
'assetTypes': 'medium_video_s3'
|
||||||
|
}))
|
||||||
|
return info
|
||||||
|
|
||||||
|
|
||||||
|
class HistoryTopicIE(AENetworksBaseIE):
|
||||||
|
IE_NAME = 'history:topic'
|
||||||
|
IE_DESC = 'History.com Topic'
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?history\.com/topics/(?:[^/]+/)?(?P<topic_id>[^/]+)/videos(?:/(?P<video_display_id>[^/?#]+))?'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://www.history.com/topics/valentines-day/history-of-valentines-day/videos/bet-you-didnt-know-valentines-day?m=528e394da93ae&s=undefined&f=1&free=false',
|
'url': 'http://www.history.com/topics/valentines-day/history-of-valentines-day/videos/bet-you-didnt-know-valentines-day?m=528e394da93ae&s=undefined&f=1&free=false',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'g12m5Gyt3fdR',
|
'id': '40700995724',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': "Bet You Didn't Know: Valentine's Day",
|
'title': "Bet You Didn't Know: Valentine's Day",
|
||||||
'description': 'md5:7b57ea4829b391995b405fa60bd7b5f7',
|
'description': 'md5:7b57ea4829b391995b405fa60bd7b5f7',
|
||||||
@@ -31,57 +136,39 @@ class AENetworksIE(InfoExtractor):
|
|||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
'add_ie': ['ThePlatform'],
|
'add_ie': ['ThePlatform'],
|
||||||
'expected_warnings': ['JSON-LD'],
|
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.history.com/shows/mountain-men/season-1/episode-1',
|
'url': 'http://www.history.com/topics/world-war-i/world-war-i-history/videos',
|
||||||
'md5': '8ff93eb073449f151d6b90c0ae1ef0c7',
|
'info_dict':
|
||||||
'info_dict': {
|
{
|
||||||
'id': 'eg47EERs_JsZ',
|
'id': 'world-war-i-history',
|
||||||
'ext': 'mp4',
|
'title': 'World War I History',
|
||||||
'title': 'Winter Is Coming',
|
|
||||||
'description': 'md5:641f424b7a19d8e24f26dea22cf59d74',
|
|
||||||
'timestamp': 1338306241,
|
|
||||||
'upload_date': '20120529',
|
|
||||||
'uploader': 'AENE-NEW',
|
|
||||||
},
|
},
|
||||||
'add_ie': ['ThePlatform'],
|
'playlist_mincount': 24,
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.aetv.com/shows/duck-dynasty/video/inlawful-entry',
|
'url': 'http://www.history.com/topics/world-war-i-history/videos',
|
||||||
'only_matching': True
|
'only_matching': True,
|
||||||
}, {
|
|
||||||
'url': 'http://www.fyi.tv/shows/tiny-house-nation/videos/207-sq-ft-minnesota-prairie-cottage',
|
|
||||||
'only_matching': True
|
|
||||||
}, {
|
|
||||||
'url': 'http://www.mylifetime.com/shows/project-runway-junior/video/season-1/episode-6/superstar-clients',
|
|
||||||
'only_matching': True
|
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
page_type, video_id = re.match(self._VALID_URL, url).groups()
|
topic_id, video_display_id = re.match(self._VALID_URL, url).groups()
|
||||||
|
if video_display_id:
|
||||||
|
webpage = self._download_webpage(url, video_display_id)
|
||||||
|
release_url, video_id = re.search(r"_videoPlayer.play\('([^']+)'\s*,\s*'[^']+'\s*,\s*'(\d+)'\)", webpage).groups()
|
||||||
|
release_url = unescapeHTML(release_url)
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
return self.theplatform_url_result(
|
||||||
|
release_url, video_id, {
|
||||||
video_url_re = [
|
'mbr': 'true',
|
||||||
r'data-href="[^"]*/%s"[^>]+data-release-url="([^"]+)"' % video_id,
|
'switch': 'hls'
|
||||||
r"media_url\s*=\s*'([^']+)'"
|
})
|
||||||
]
|
else:
|
||||||
video_url = unescapeHTML(self._search_regex(video_url_re, webpage, 'video url'))
|
webpage = self._download_webpage(url, topic_id)
|
||||||
query = {'mbr': 'true'}
|
entries = []
|
||||||
if page_type == 'shows':
|
for episode_item in re.findall(r'<a.+?data-release-url="[^"]+"[^>]*>', webpage):
|
||||||
query['assetTypes'] = 'medium_video_s3'
|
video_attributes = extract_attributes(episode_item)
|
||||||
if 'switch=hds' in video_url:
|
entries.append(self.theplatform_url_result(
|
||||||
query['switch'] = 'hls'
|
video_attributes['data-release-url'], video_attributes['data-id'], {
|
||||||
|
'mbr': 'true',
|
||||||
info = self._search_json_ld(webpage, video_id, fatal=False)
|
'switch': 'hls'
|
||||||
info.update({
|
}))
|
||||||
'_type': 'url_transparent',
|
return self.playlist_result(entries, topic_id, get_element_by_attribute('class', 'show-title', webpage))
|
||||||
'url': smuggle_url(
|
|
||||||
update_url_query(video_url, query),
|
|
||||||
{
|
|
||||||
'sig': {
|
|
||||||
'key': 'crazyjava',
|
|
||||||
'secret': 's3cr3t'},
|
|
||||||
'force_smil_url': True
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
return info
|
|
||||||
|
|||||||
133
youtube_dl/extractor/afreecatv.py
Normal file
133
youtube_dl/extractor/afreecatv.py
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..compat import (
|
||||||
|
compat_urllib_parse_urlparse,
|
||||||
|
compat_urlparse,
|
||||||
|
)
|
||||||
|
from ..utils import (
|
||||||
|
ExtractorError,
|
||||||
|
int_or_none,
|
||||||
|
xpath_element,
|
||||||
|
xpath_text,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class AfreecaTVIE(InfoExtractor):
|
||||||
|
IE_DESC = 'afreecatv.com'
|
||||||
|
_VALID_URL = r'''(?x)^
|
||||||
|
https?://(?:(live|afbbs|www)\.)?afreeca(?:tv)?\.com(?::\d+)?
|
||||||
|
(?:
|
||||||
|
/app/(?:index|read_ucc_bbs)\.cgi|
|
||||||
|
/player/[Pp]layer\.(?:swf|html))
|
||||||
|
\?.*?\bnTitleNo=(?P<id>\d+)'''
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://live.afreecatv.com:8079/app/index.cgi?szType=read_ucc_bbs&szBjId=dailyapril&nStationNo=16711924&nBbsNo=18605867&nTitleNo=36164052&szSkin=',
|
||||||
|
'md5': 'f72c89fe7ecc14c1b5ce506c4996046e',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '36164052',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': '데일리 에이프릴 요정들의 시상식!',
|
||||||
|
'thumbnail': 're:^https?://(?:video|st)img.afreecatv.com/.*$',
|
||||||
|
'uploader': 'dailyapril',
|
||||||
|
'uploader_id': 'dailyapril',
|
||||||
|
'upload_date': '20160503',
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'url': 'http://afbbs.afreecatv.com:8080/app/read_ucc_bbs.cgi?nStationNo=16711924&nTitleNo=36153164&szBjId=dailyapril&nBbsNo=18605867',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '36153164',
|
||||||
|
'title': "BJ유트루와 함께하는 '팅커벨 메이크업!'",
|
||||||
|
'thumbnail': 're:^https?://(?:video|st)img.afreecatv.com/.*$',
|
||||||
|
'uploader': 'dailyapril',
|
||||||
|
'uploader_id': 'dailyapril',
|
||||||
|
},
|
||||||
|
'playlist_count': 2,
|
||||||
|
'playlist': [{
|
||||||
|
'md5': 'd8b7c174568da61d774ef0203159bf97',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '36153164_1',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': "BJ유트루와 함께하는 '팅커벨 메이크업!'",
|
||||||
|
'upload_date': '20160502',
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'md5': '58f2ce7f6044e34439ab2d50612ab02b',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '36153164_2',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': "BJ유트루와 함께하는 '팅커벨 메이크업!'",
|
||||||
|
'upload_date': '20160502',
|
||||||
|
},
|
||||||
|
}],
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.afreecatv.com/player/Player.swf?szType=szBjId=djleegoon&nStationNo=11273158&nBbsNo=13161095&nTitleNo=36327652',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def parse_video_key(key):
|
||||||
|
video_key = {}
|
||||||
|
m = re.match(r'^(?P<upload_date>\d{8})_\w+_(?P<part>\d+)$', key)
|
||||||
|
if m:
|
||||||
|
video_key['upload_date'] = m.group('upload_date')
|
||||||
|
video_key['part'] = m.group('part')
|
||||||
|
return video_key
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
parsed_url = compat_urllib_parse_urlparse(url)
|
||||||
|
info_url = compat_urlparse.urlunparse(parsed_url._replace(
|
||||||
|
netloc='afbbs.afreecatv.com:8080',
|
||||||
|
path='/api/video/get_video_info.php'))
|
||||||
|
video_xml = self._download_xml(info_url, video_id)
|
||||||
|
|
||||||
|
if xpath_element(video_xml, './track/video/file') is None:
|
||||||
|
raise ExtractorError('Specified AfreecaTV video does not exist',
|
||||||
|
expected=True)
|
||||||
|
|
||||||
|
title = xpath_text(video_xml, './track/title', 'title')
|
||||||
|
uploader = xpath_text(video_xml, './track/nickname', 'uploader')
|
||||||
|
uploader_id = xpath_text(video_xml, './track/bj_id', 'uploader id')
|
||||||
|
duration = int_or_none(xpath_text(video_xml, './track/duration',
|
||||||
|
'duration'))
|
||||||
|
thumbnail = xpath_text(video_xml, './track/titleImage', 'thumbnail')
|
||||||
|
|
||||||
|
entries = []
|
||||||
|
for i, video_file in enumerate(video_xml.findall('./track/video/file')):
|
||||||
|
video_key = self.parse_video_key(video_file.get('key', ''))
|
||||||
|
if not video_key:
|
||||||
|
continue
|
||||||
|
entries.append({
|
||||||
|
'id': '%s_%s' % (video_id, video_key.get('part', i + 1)),
|
||||||
|
'title': title,
|
||||||
|
'upload_date': video_key.get('upload_date'),
|
||||||
|
'duration': int_or_none(video_file.get('duration')),
|
||||||
|
'url': video_file.text,
|
||||||
|
})
|
||||||
|
|
||||||
|
info = {
|
||||||
|
'id': video_id,
|
||||||
|
'title': title,
|
||||||
|
'uploader': uploader,
|
||||||
|
'uploader_id': uploader_id,
|
||||||
|
'duration': duration,
|
||||||
|
'thumbnail': thumbnail,
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(entries) > 1:
|
||||||
|
info['_type'] = 'multi_video'
|
||||||
|
info['entries'] = entries
|
||||||
|
elif len(entries) == 1:
|
||||||
|
info['url'] = entries[0]['url']
|
||||||
|
info['upload_date'] = entries[0].get('upload_date')
|
||||||
|
else:
|
||||||
|
raise ExtractorError(
|
||||||
|
'No files found for the specified AfreecaTV video, either'
|
||||||
|
' the URL is incorrect or the video has been made private.',
|
||||||
|
expected=True)
|
||||||
|
|
||||||
|
return info
|
||||||
@@ -24,10 +24,10 @@ class AftonbladetIE(InfoExtractor):
|
|||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
# find internal video meta data
|
# find internal video meta data
|
||||||
meta_url = 'http://aftonbladet-play.drlib.aptoma.no/video/%s.json'
|
meta_url = 'http://aftonbladet-play-metadata.cdn.drvideo.aptoma.no/video/%s.json'
|
||||||
player_config = self._parse_json(self._html_search_regex(
|
player_config = self._parse_json(self._html_search_regex(
|
||||||
r'data-player-config="([^"]+)"', webpage, 'player config'), video_id)
|
r'data-player-config="([^"]+)"', webpage, 'player config'), video_id)
|
||||||
internal_meta_id = player_config['videoId']
|
internal_meta_id = player_config['aptomaVideoId']
|
||||||
internal_meta_url = meta_url % internal_meta_id
|
internal_meta_url = meta_url % internal_meta_id
|
||||||
internal_meta_json = self._download_json(
|
internal_meta_json = self._download_json(
|
||||||
internal_meta_url, video_id, 'Downloading video meta data')
|
internal_meta_url, video_id, 'Downloading video meta data')
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class AMPIE(InfoExtractor):
|
|||||||
for media_data in media_content:
|
for media_data in media_content:
|
||||||
media = media_data['@attributes']
|
media = media_data['@attributes']
|
||||||
media_type = media['type']
|
media_type = media['type']
|
||||||
if media_type == 'video/f4m':
|
if media_type in ('video/f4m', 'application/f4m+xml'):
|
||||||
formats.extend(self._extract_f4m_formats(
|
formats.extend(self._extract_f4m_formats(
|
||||||
media['url'] + '?hdcore=3.4.0&plugin=aasp-3.4.0.132.124',
|
media['url'] + '?hdcore=3.4.0&plugin=aasp-3.4.0.132.124',
|
||||||
video_id, f4m_id='hds', fatal=False))
|
video_id, f4m_id='hds', fatal=False))
|
||||||
@@ -61,7 +61,7 @@ class AMPIE(InfoExtractor):
|
|||||||
media['url'], video_id, 'mp4', m3u8_id='hls', fatal=False))
|
media['url'], video_id, 'mp4', m3u8_id='hls', fatal=False))
|
||||||
else:
|
else:
|
||||||
formats.append({
|
formats.append({
|
||||||
'format_id': media_data['media-category']['@attributes']['label'],
|
'format_id': media_data.get('media-category', {}).get('@attributes', {}).get('label'),
|
||||||
'url': media['url'],
|
'url': media['url'],
|
||||||
'tbr': int_or_none(media.get('bitrate')),
|
'tbr': int_or_none(media.get('bitrate')),
|
||||||
'filesize': int_or_none(media.get('fileSize')),
|
'filesize': int_or_none(media.get('fileSize')),
|
||||||
|
|||||||
224
youtube_dl/extractor/anvato.py
Normal file
224
youtube_dl/extractor/anvato.py
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import base64
|
||||||
|
import hashlib
|
||||||
|
import json
|
||||||
|
import random
|
||||||
|
import time
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..aes import aes_encrypt
|
||||||
|
from ..compat import compat_str
|
||||||
|
from ..utils import (
|
||||||
|
bytes_to_intlist,
|
||||||
|
determine_ext,
|
||||||
|
intlist_to_bytes,
|
||||||
|
int_or_none,
|
||||||
|
strip_jsonp,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def md5_text(s):
|
||||||
|
if not isinstance(s, compat_str):
|
||||||
|
s = compat_str(s)
|
||||||
|
return hashlib.md5(s.encode('utf-8')).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
|
class AnvatoIE(InfoExtractor):
|
||||||
|
# Copied from anvplayer.min.js
|
||||||
|
_ANVACK_TABLE = {
|
||||||
|
'nbcu_nbcd_desktop_web_prod_93d8ead38ce2024f8f544b78306fbd15895ae5e6': 'NNemUkySjxLyPTKvZRiGntBIjEyK8uqicjMakIaQ',
|
||||||
|
'nbcu_nbcd_desktop_web_qa_1a6f01bdd0dc45a439043b694c8a031d': 'eSxJUbA2UUKBTXryyQ2d6NuM8oEqaPySvaPzfKNA',
|
||||||
|
'nbcu_nbcd_desktop_web_acc_eb2ff240a5d4ae9a63d4c297c32716b6c523a129': '89JR3RtUGbvKuuJIiKOMK0SoarLb5MUx8v89RcbP',
|
||||||
|
'nbcu_nbcd_watchvod_web_prod_e61107507180976724ec8e8319fe24ba5b4b60e1': 'Uc7dFt7MJ9GsBWB5T7iPvLaMSOt8BBxv4hAXk5vv',
|
||||||
|
'nbcu_nbcd_watchvod_web_qa_42afedba88a36203db5a4c09a5ba29d045302232': 'T12oDYVFP2IaFvxkmYMy5dKxswpLHtGZa4ZAXEi7',
|
||||||
|
'nbcu_nbcd_watchvod_web_acc_9193214448e2e636b0ffb78abacfd9c4f937c6ca': 'MmobcxUxMedUpohNWwXaOnMjlbiyTOBLL6d46ZpR',
|
||||||
|
'nbcu_local_monitor_web_acc_f998ad54eaf26acd8ee033eb36f39a7b791c6335': 'QvfIoPYrwsjUCcASiw3AIkVtQob2LtJHfidp9iWg',
|
||||||
|
'nbcu_cable_monitor_web_acc_a413759603e8bedfcd3c61b14767796e17834077': 'uwVPJLShvJWSs6sWEIuVem7MTF8A4IknMMzIlFto',
|
||||||
|
'nbcu_nbcd_mcpstage_web_qa_4c43a8f6e95a88dbb40276c0630ba9f693a63a4e': 'PxVYZVwjhgd5TeoPRxL3whssb5OUPnM3zyAzq8GY',
|
||||||
|
'nbcu_comcast_comcast_web_prod_074080762ad4ce956b26b43fb22abf153443a8c4': 'afnaRZfDyg1Z3WZHdupKfy6xrbAG2MHqe3VfuSwh',
|
||||||
|
'nbcu_comcast_comcast_web_qa_706103bb93ead3ef70b1de12a0e95e3c4481ade0': 'DcjsVbX9b3uoPlhdriIiovgFQZVxpISZwz0cx1ZK',
|
||||||
|
'nbcu_comcast_comcastcable_web_prod_669f04817536743563d7331c9293e59fbdbe3d07': '0RwMN2cWy10qhAhOscq3eK7aEe0wqnKt3vJ0WS4D',
|
||||||
|
'nbcu_comcast_comcastcable_web_qa_3d9d2d66219094127f0f6b09cc3c7bb076e3e1ca': '2r8G9DEya7PCqBceKZgrn2XkXgASjwLMuaFE1Aad',
|
||||||
|
'hearst_hearst_demo_web_stage_960726dfef3337059a01a78816e43b29ec04dfc7': 'cuZBPXTR6kSdoTCVXwk5KGA8rk3NrgGn4H6e9Dsp',
|
||||||
|
'anvato_mcpqa_demo_web_stage_18b55e00db5a13faa8d03ae6e41f6f5bcb15b922': 'IOaaLQ8ymqVyem14QuAvE5SndQynTcH5CrLkU2Ih',
|
||||||
|
'anvato_nextmedia_demo_web_stage_9787d56a02ff6b9f43e9a2b0920d8ca88beb5818': 'Pqu9zVzI1ApiIzbVA3VkGBEQHvdKSUuKpD6s2uaR',
|
||||||
|
'anvato_scripps_app_web_prod_0837996dbe373629133857ae9eb72e740424d80a': 'du1ccmn7RxzgizwbWU7hyUaGodNlJn7HtXI0WgXW',
|
||||||
|
'anvato_scripps_app_web_stage_360797e00fe2826be142155c4618cc52fce6c26c': '2PMrQ0BRoqCWl7nzphj0GouIMEh2mZYivAT0S1Su',
|
||||||
|
'fs2go_fs2go_go_all_prod_21934911ccfafc03a075894ead2260d11e2ddd24': 'RcuHlKikW2IJw6HvVoEkqq2UsuEJlbEl11pWXs4Q',
|
||||||
|
'fs2go_fs2go_go_web_prod_ead4b0eec7460c1a07783808db21b49cf1f2f9a7': '4K0HTT2u1zkQA2MaGaZmkLa1BthGSBdr7jllrhk5',
|
||||||
|
'fs2go_fs2go_go_web_stage_407585454a4400355d4391691c67f361': 'ftnc37VKRJBmHfoGGi3kT05bHyeJzilEzhKJCyl3',
|
||||||
|
'fs2go_fs2go_go_android_stage_44b714db6f8477f29afcba15a41e1d30': 'CtxpPvVpo6AbZGomYUhkKs7juHZwNml9b9J0J2gI',
|
||||||
|
'anvato_cbslocal_app_web_prod_547f3e49241ef0e5d30c79b2efbca5d92c698f67': 'Pw0XX5KBDsyRnPS0R2JrSrXftsy8Jnz5pAjaYC8s',
|
||||||
|
'anvato_cbslocal_app_web_stage_547a5f096594cd3e00620c6f825cad1096d28c80': '37OBUhX2uwNyKhhrNzSSNHSRPZpApC3trdqDBpuz',
|
||||||
|
'fs2go_att_att_web_prod_1042dddd089a05438b6a08f972941176f699ffd8': 'JLcF20JwYvpv6uAGcLWIaV12jKwaL1R8us4b6Zkg',
|
||||||
|
'fs2go_att_att_web_stage_807c5001955fc114a3331fe027ddc76e': 'gbu1oO1y0JiOFh4SUipt86P288JHpyjSqolrrT1x',
|
||||||
|
'fs2go_fs2go_tudor_web_prod_a7dd8e5a7cdc830cae55eae6f3e9fee5ee49eb9b': 'ipcp87VCEZXPPe868j3orLqzc03oTy7DXsGkAXXH',
|
||||||
|
'anvato_mhz_app_web_prod_b808218b30de7fdf60340cbd9831512bc1bf6d37': 'Stlm5Gs6BEhJLRTZHcNquyzxGqr23EuFmE5DCgjX',
|
||||||
|
'fs2go_charter_charter_web_stage_c2c6e5a68375a1bf00fff213d3ff8f61a835a54c': 'Lz4hbJp1fwL6jlcz4M2PMzghM4jp4aAmybtT5dPc',
|
||||||
|
'fs2go_charter_charter_web_prod_ebfe3b10f1af215a7321cd3d629e0b81dfa6fa8c': 'vUJsK345A1bVmyYDRhZX0lqFIgVXuqhmuyp1EtPK',
|
||||||
|
'anvato_epfox_app_web_prod_b3373168e12f423f41504f207000188daf88251b': 'GDKq1ixvX3MoBNdU5IOYmYa2DTUXYOozPjrCJnW7',
|
||||||
|
'anvato_epfox_app_web_stage_a3c2ce60f8f83ef374a88b68ee73a950f8ab87ce': '2jz2NH4BsXMaDsoJ5qkHMbcczAfIReo2eFYuVC1C',
|
||||||
|
'fs2go_verizon_verizon_web_stage_08e6df0354a4803f1b1f2428b5a9a382e8dbcd62': 'rKTVapNaAcmnUbGL4ZcuOoY4SE7VmZSQsblPFr7e',
|
||||||
|
'fs2go_verizon_verizon_web_prod_f909564cb606eff1f731b5e22e0928676732c445': 'qLSUuHerM3u9eNPzaHyUK52obai5MvE4XDJfqYe1',
|
||||||
|
'fs2go_foxcom_synd_web_stage_f7b9091f00ea25a4fdaaae77fca5b54cdc7e7043': '96VKF2vLd24fFiDfwPFpzM5llFN4TiIGAlodE0Re',
|
||||||
|
'fs2go_foxcom_synd_web_prod_0f2cdd64d87e4ab6a1d54aada0ff7a7c8387a064': 'agiPjbXEyEZUkbuhcnmVPhe9NNVbDjCFq2xkcx51',
|
||||||
|
'anvato_own_app_web_stage_1214ade5d28422c4dae9d03c1243aba0563c4dba': 'mzhamNac3swG4WsJAiUTacnGIODi6SWeVWk5D7ho',
|
||||||
|
'anvato_own_app_web_prod_944e162ed927ec3e9ed13eb68ed2f1008ee7565e': '9TSxh6G2TXOLBoYm9ro3LdNjjvnXpKb8UR8KoIP9',
|
||||||
|
'anvato_scripps_app_ftv_prod_a10a10468edd5afb16fb48171c03b956176afad1': 'COJ2i2UIPK7xZqIWswxe7FaVBOVgRkP1F6O6qGoH',
|
||||||
|
'anvato_scripps_app_ftv_stage_77d3ad2bdb021ec37ca2e35eb09acd396a974c9a': 'Q7nnopNLe2PPfGLOTYBqxSaRpl209IhqaEuDZi1F',
|
||||||
|
'anvato_univision_app_web_stage_551236ef07a0e17718c3995c35586b5ed8cb5031': 'D92PoLS6UitwxDRA191HUGT9OYcOjV6mPMa5wNyo',
|
||||||
|
'anvato_univision_app_web_prod_039a5c0a6009e637ae8ac906718a79911e0e65e1': '5mVS5u4SQjtw6NGw2uhMbKEIONIiLqRKck5RwQLR',
|
||||||
|
'nbcu_cnbc_springfield_ios_prod_670207fae43d6e9a94c351688851a2ce': 'M7fqCCIP9lW53oJbHs19OlJlpDrVyc2OL8gNeuTa',
|
||||||
|
'nbcu_cnbc_springfieldvod_ios_prod_7a5f04b1ceceb0e9c9e2264a44aa236e08e034c2': 'Yia6QbJahW0S7K1I0drksimhZb4UFq92xLBmmMvk',
|
||||||
|
'anvato_cox_app_web_prod_ce45cda237969f93e7130f50ee8bb6280c1484ab': 'cc0miZexpFtdoqZGvdhfXsLy7FXjRAOgb9V0f5fZ',
|
||||||
|
'anvato_cox_app_web_stage_c23dbe016a8e9d8c7101d10172b92434f6088bf9': 'yivU3MYHd2eDZcOfmLbINVtqxyecKTOp8OjOuoGJ',
|
||||||
|
'anvato_chnzero_app_web_stage_b1164d1352b579e792e542fddf13ee34c0eeb46b': 'A76QkXMmVH8lTCfU15xva1mZnSVcqeY4Xb22Kp7m',
|
||||||
|
'anvato_chnzero_app_web_prod_253d358928dc08ec161eda2389d53707288a730c': 'OA5QI3ZWZZkdtUEDqh28AH8GedsF6FqzJI32596b',
|
||||||
|
'anvato_discovery_vodpoc_web_stage_9fa7077b5e8af1f8355f65d4fb8d2e0e9d54e2b7': 'q3oT191tTQ5g3JCP67PkjLASI9s16DuWZ6fYmry3',
|
||||||
|
'anvato_discovery_vodpoc_web_prod_688614983167a1af6cdf6d76343fda10a65223c1': 'qRvRQCTVHd0VVOHsMvvfidyWmlYVrTbjby7WqIuK',
|
||||||
|
'nbcu_cnbc_springfieldvod_ftv_stage_826040aad1925a46ac5dfb4b3c5143e648c6a30d': 'JQaSb5a8Tz0PT4ti329DNmzDO30TnngTHmvX8Vua',
|
||||||
|
'nbcu_cnbc_springfield_ftv_stage_826040aad1925a46ac5dfb4b3c5143e648c6a30d': 'JQaSb5a8Tz0PT4ti329DNmzDO30TnngTHmvX8Vua',
|
||||||
|
'nbcu_nbcd_capture_web_stage_4dd9d585bfb984ebf856dee35db027b2465cc4ae': '0j1Ov4Vopyi2HpBZJYdL2m8ERJVGYh3nNpzPiO8F',
|
||||||
|
'nbcu_nbcd_watch3_android_prod_7712ca5fcf1c22f19ec1870a9650f9c37db22dcf': '3LN2UB3rPUAMu7ZriWkHky9vpLMXYha8JbSnxBlx',
|
||||||
|
'nbcu_nbcd_watchvod3_android_prod_0910a3a4692d57c0b5ff4316075bc5d096be45b9': 'mJagcQ2II30vUOAauOXne7ERwbf5S9nlB3IP17lQ',
|
||||||
|
'anvato_scripps_app_atv_prod_790deda22e16e71e83df58f880cd389908a45d52': 'CB6trI1mpoDIM5o54DNTsji90NDBQPZ4z4RqBNSH',
|
||||||
|
'nbcu_nbcd_watchv4_android_prod_ff67cef9cb409158c6f8c3533edddadd0b750507': 'j8CHQCUWjlYERj4NFRmUYOND85QNbHViH09UwuKm',
|
||||||
|
'nbcu_nbcd_watchvodv4_android_prod_a814d781609989dea6a629d50ae4c7ad8cc8e907': 'rkVnUXxdA9rawVLUlDQtMue9Y4Q7lFEaIotcUhjt',
|
||||||
|
'rvVKpA50qlOPLFxMjrCGf5pdkdQDm7qn': '1J7ZkY5Qz5lMLi93QOH9IveE7EYB3rLl',
|
||||||
|
'nbcu_dtv_local_web_prod_b266cf49defe255fd4426a97e27c09e513e9f82f': 'HuLnJDqzLa4saCzYMJ79zDRSQpEduw1TzjMNQu2b',
|
||||||
|
'nbcu_att_local_web_prod_4cef038b2d969a6b7d700a56a599040b6a619f67': 'Q0Em5VDc2KpydUrVwzWRXAwoNBulWUxCq2faK0AV',
|
||||||
|
'nbcu_dish_local_web_prod_c56dcaf2da2e9157a4266c82a78195f1dd570f6b': 'bC1LWmRz9ayj2AlzizeJ1HuhTfIaJGsDBnZNgoRg',
|
||||||
|
'nbcu_verizon_local_web_prod_88bebd2ce006d4ed980de8133496f9a74cb9b3e1': 'wzhDKJZpgvUSS1EQvpCQP8Q59qVzcPixqDGJefSk',
|
||||||
|
'nbcu_charter_local_web_prod_9ad90f7fc4023643bb718f0fe0fd5beea2382a50': 'PyNbxNhEWLzy1ZvWEQelRuIQY88Eub7xbSVRMdfT',
|
||||||
|
'nbcu_suddenlink_local_web_prod_20fb711725cac224baa1c1cb0b1c324d25e97178': '0Rph41lPXZbb3fqeXtHjjbxfSrNbtZp1Ygq7Jypa',
|
||||||
|
'nbcu_wow_local_web_prod_652d9ce4f552d9c2e7b5b1ed37b8cb48155174ad': 'qayIBZ70w1dItm2zS42AptXnxW15mkjRrwnBjMPv',
|
||||||
|
'nbcu_centurylink_local_web_prod_2034402b029bf3e837ad46814d9e4b1d1345ccd5': 'StePcPMkjsX51PcizLdLRMzxMEl5k2FlsMLUNV4k',
|
||||||
|
'nbcu_atlanticbrd_local_web_prod_8d5f5ecbf7f7b2f5e6d908dd75d90ae3565f682e': 'NtYLb4TFUS0pRs3XTkyO5sbVGYjVf17bVbjaGscI',
|
||||||
|
'nbcu_nbcd_watchvod_web_dev_08bc05699be47c4f31d5080263a8cfadc16d0f7c': 'hwxi2dgDoSWgfmVVXOYZm14uuvku4QfopstXckhr',
|
||||||
|
'anvato_nextmedia_app_web_prod_a4fa8c7204aa65e71044b57aaf63711980cfe5a0': 'tQN1oGPYY1nM85rJYePWGcIb92TG0gSqoVpQTWOw',
|
||||||
|
'anvato_mcp_lin_web_prod_4c36fbfd4d8d8ecae6488656e21ac6d1ac972749': 'GUXNf5ZDX2jFUpu4WT2Go4DJ5nhUCzpnwDRRUx1K',
|
||||||
|
'anvato_mcp_univision_web_prod_37fe34850c99a3b5cdb71dab10a417dd5cdecafa': 'bLDYF8JqfG42b7bwKEgQiU9E2LTIAtnKzSgYpFUH',
|
||||||
|
'anvato_mcp_fs2go_web_prod_c7b90a93e171469cdca00a931211a2f556370d0a': 'icgGoYGipQMMSEvhplZX1pwbN69srwKYWksz3xWK',
|
||||||
|
'anvato_mcp_sps_web_prod_54bdc90dd6ba21710e9f7074338365bba28da336': 'fA2iQdI7RDpynqzQYIpXALVS83NTPr8LLFK4LFsu',
|
||||||
|
'anvato_mcp_anv_web_prod_791407490f4c1ef2a4bcb21103e0cb1bcb3352b3': 'rMOUZqe9lwcGq2mNgG3EDusm6lKgsUnczoOX3mbg',
|
||||||
|
'anvato_mcp_gray_web_prod_4c10f067c393ed8fc453d3930f8ab2b159973900': 'rMOUZqe9lwcGq2mNgG3EDusm6lKgsUnczoOX3mbg',
|
||||||
|
'anvato_mcp_hearst_web_prod_5356c3de0fc7c90a3727b4863ca7fec3a4524a99': 'P3uXJ0fXXditBPCGkfvlnVScpPEfKmc64Zv7ZgbK',
|
||||||
|
'anvato_mcp_cbs_web_prod_02f26581ff80e5bda7aad28226a8d369037f2cbe': 'mGPvo5ZA5SgjOFAPEPXv7AnOpFUICX8hvFQVz69n',
|
||||||
|
'anvato_mcp_telemundo_web_prod_c5278d51ad46fda4b6ca3d0ea44a7846a054f582': 'qyT6PXXLjVNCrHaRVj0ugAhalNRS7Ee9BP7LUokD',
|
||||||
|
'nbcu_nbcd_watchvodv4_web_stage_4108362fba2d4ede21f262fea3c4162cbafd66c7': 'DhaU5lj0W2gEdcSSsnxURq8t7KIWtJfD966crVDk',
|
||||||
|
'anvato_scripps_app_ios_prod_409c41960c60b308db43c3cc1da79cab9f1c3d93': 'WPxj5GraLTkYCyj3M7RozLqIycjrXOEcDGFMIJPn',
|
||||||
|
'EZqvRyKBJLrgpClDPDF8I7Xpdp40Vx73': '4OxGd2dEakylntVKjKF0UK9PDPYB6A9W',
|
||||||
|
'M2v78QkpleXm9hPp9jUXI63x5vA6BogR': 'ka6K32k7ZALmpINkjJUGUo0OE42Md1BQ',
|
||||||
|
'nbcu_nbcd_desktop_web_prod_93d8ead38ce2024f8f544b78306fbd15895ae5e6_secure': 'NNemUkySjxLyPTKvZRiGntBIjEyK8uqicjMakIaQ'
|
||||||
|
}
|
||||||
|
|
||||||
|
_AUTH_KEY = b'\x31\xc2\x42\x84\x9e\x73\xa0\xce'
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super(AnvatoIE, self).__init__(*args, **kwargs)
|
||||||
|
self.__server_time = None
|
||||||
|
|
||||||
|
def _server_time(self, access_key, video_id):
|
||||||
|
if self.__server_time is not None:
|
||||||
|
return self.__server_time
|
||||||
|
|
||||||
|
self.__server_time = int(self._download_json(
|
||||||
|
self._api_prefix(access_key) + 'server_time?anvack=' + access_key, video_id,
|
||||||
|
note='Fetching server time')['server_time'])
|
||||||
|
|
||||||
|
return self.__server_time
|
||||||
|
|
||||||
|
def _api_prefix(self, access_key):
|
||||||
|
return 'https://tkx2-%s.anvato.net/rest/v2/' % ('prod' if 'prod' in access_key else 'stage')
|
||||||
|
|
||||||
|
def _get_video_json(self, access_key, video_id):
|
||||||
|
# See et() in anvplayer.min.js, which is an alias of getVideoJSON()
|
||||||
|
video_data_url = self._api_prefix(access_key) + 'mcp/video/%s?anvack=%s' % (video_id, access_key)
|
||||||
|
server_time = self._server_time(access_key, video_id)
|
||||||
|
input_data = '%d~%s~%s' % (server_time, md5_text(video_data_url), md5_text(server_time))
|
||||||
|
|
||||||
|
auth_secret = intlist_to_bytes(aes_encrypt(
|
||||||
|
bytes_to_intlist(input_data[:64]), bytes_to_intlist(self._AUTH_KEY)))
|
||||||
|
|
||||||
|
video_data_url += '&X-Anvato-Adst-Auth=' + base64.b64encode(auth_secret).decode('ascii')
|
||||||
|
anvrid = md5_text(time.time() * 1000 * random.random())[:30]
|
||||||
|
payload = {
|
||||||
|
'api': {
|
||||||
|
'anvrid': anvrid,
|
||||||
|
'anvstk': md5_text('%s|%s|%d|%s' % (
|
||||||
|
access_key, anvrid, server_time, self._ANVACK_TABLE[access_key])),
|
||||||
|
'anvts': server_time,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return self._download_json(
|
||||||
|
video_data_url, video_id, transform_source=strip_jsonp,
|
||||||
|
data=json.dumps(payload).encode('utf-8'))
|
||||||
|
|
||||||
|
def _extract_anvato_videos(self, webpage, video_id):
|
||||||
|
anvplayer_data = self._parse_json(self._html_search_regex(
|
||||||
|
r'<script[^>]+data-anvp=\'([^\']+)\'', webpage,
|
||||||
|
'Anvato player data'), video_id)
|
||||||
|
|
||||||
|
video_id = anvplayer_data['video']
|
||||||
|
access_key = anvplayer_data['accessKey']
|
||||||
|
|
||||||
|
video_data = self._get_video_json(access_key, video_id)
|
||||||
|
|
||||||
|
formats = []
|
||||||
|
for published_url in video_data['published_urls']:
|
||||||
|
video_url = published_url['embed_url']
|
||||||
|
ext = determine_ext(video_url)
|
||||||
|
|
||||||
|
if ext == 'smil':
|
||||||
|
formats.extend(self._extract_smil_formats(video_url, video_id))
|
||||||
|
continue
|
||||||
|
|
||||||
|
tbr = int_or_none(published_url.get('kbps'))
|
||||||
|
a_format = {
|
||||||
|
'url': video_url,
|
||||||
|
'format_id': ('-'.join(filter(None, ['http', published_url.get('cdn_name')]))).lower(),
|
||||||
|
'tbr': tbr if tbr != 0 else None,
|
||||||
|
}
|
||||||
|
|
||||||
|
if ext == 'm3u8':
|
||||||
|
# Not using _extract_m3u8_formats here as individual media
|
||||||
|
# playlists are also included in published_urls.
|
||||||
|
if tbr is None:
|
||||||
|
formats.append(self._m3u8_meta_format(video_url, ext='mp4', m3u8_id='hls'))
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
a_format.update({
|
||||||
|
'format_id': '-'.join(filter(None, ['hls', compat_str(tbr)])),
|
||||||
|
'ext': 'mp4',
|
||||||
|
})
|
||||||
|
elif ext == 'mp3':
|
||||||
|
a_format['vcodec'] = 'none'
|
||||||
|
else:
|
||||||
|
a_format.update({
|
||||||
|
'width': int_or_none(published_url.get('width')),
|
||||||
|
'height': int_or_none(published_url.get('height')),
|
||||||
|
})
|
||||||
|
formats.append(a_format)
|
||||||
|
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
subtitles = {}
|
||||||
|
for caption in video_data.get('captions', []):
|
||||||
|
a_caption = {
|
||||||
|
'url': caption['url'],
|
||||||
|
'ext': 'tt' if caption.get('format') == 'SMPTE-TT' else None
|
||||||
|
}
|
||||||
|
subtitles.setdefault(caption['language'], []).append(a_caption)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'formats': formats,
|
||||||
|
'title': video_data.get('def_title'),
|
||||||
|
'description': video_data.get('def_description'),
|
||||||
|
'categories': video_data.get('categories'),
|
||||||
|
'thumbnail': video_data.get('thumbnail'),
|
||||||
|
'subtitles': subtitles,
|
||||||
|
}
|
||||||
@@ -1,26 +1,113 @@
|
|||||||
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
ExtractorError,
|
||||||
|
int_or_none,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AolIE(InfoExtractor):
|
class AolIE(InfoExtractor):
|
||||||
IE_NAME = 'on.aol.com'
|
IE_NAME = 'on.aol.com'
|
||||||
_VALID_URL = r'(?:aol-video:|https?://on\.aol\.com/video/.*-)(?P<id>[0-9]+)(?:$|\?)'
|
_VALID_URL = r'(?:aol-video:|https?://on\.aol\.com/(?:[^/]+/)*(?:[^/?#&]+-)?)(?P<id>[^/?#&]+)'
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
|
# video with 5min ID
|
||||||
'url': 'http://on.aol.com/video/u-s--official-warns-of-largest-ever-irs-phone-scam-518167793?icid=OnHomepageC2Wide_MustSee_Img',
|
'url': 'http://on.aol.com/video/u-s--official-warns-of-largest-ever-irs-phone-scam-518167793?icid=OnHomepageC2Wide_MustSee_Img',
|
||||||
'md5': '18ef68f48740e86ae94b98da815eec42',
|
'md5': '18ef68f48740e86ae94b98da815eec42',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '518167793',
|
'id': '518167793',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'U.S. Official Warns Of \'Largest Ever\' IRS Phone Scam',
|
'title': 'U.S. Official Warns Of \'Largest Ever\' IRS Phone Scam',
|
||||||
|
'description': 'A major phone scam has cost thousands of taxpayers more than $1 million, with less than a month until income tax returns are due to the IRS.',
|
||||||
|
'timestamp': 1395405060,
|
||||||
|
'upload_date': '20140321',
|
||||||
|
'uploader': 'Newsy Studio',
|
||||||
},
|
},
|
||||||
'add_ie': ['FiveMin'],
|
'params': {
|
||||||
|
# m3u8 download
|
||||||
|
'skip_download': True,
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
# video with vidible ID
|
||||||
|
'url': 'http://on.aol.com/video/netflix-is-raising-rates-5707d6b8e4b090497b04f706?context=PC:homepage:PL1944:1460189336183',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '5707d6b8e4b090497b04f706',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Netflix is Raising Rates',
|
||||||
|
'description': 'Netflix is rewarding millions of it’s long-standing members with an increase in cost. Veuer’s Carly Figueroa has more.',
|
||||||
|
'upload_date': '20160408',
|
||||||
|
'timestamp': 1460123280,
|
||||||
|
'uploader': 'Veuer',
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
# m3u8 download
|
||||||
|
'skip_download': True,
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'url': 'http://on.aol.com/partners/abc-551438d309eab105804dbfe8/sneak-peek-was-haley-really-framed-570eaebee4b0448640a5c944',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'http://on.aol.com/shows/park-bench-shw518173474-559a1b9be4b0c3bfad3357a7?context=SH:SHW518173474:PL4327:1460619712763',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'http://on.aol.com/video/519442220',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'aol-video:5707d6b8e4b090497b04f706',
|
||||||
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
return self.url_result('5min:%s' % video_id)
|
|
||||||
|
response = self._download_json(
|
||||||
|
'https://feedapi.b2c.on.aol.com/v1.0/app/videos/aolon/%s/details' % video_id,
|
||||||
|
video_id)['response']
|
||||||
|
if response['statusText'] != 'Ok':
|
||||||
|
raise ExtractorError('%s said: %s' % (self.IE_NAME, response['statusText']), expected=True)
|
||||||
|
|
||||||
|
video_data = response['data']
|
||||||
|
formats = []
|
||||||
|
m3u8_url = video_data.get('videoMasterPlaylist')
|
||||||
|
if m3u8_url:
|
||||||
|
formats.extend(self._extract_m3u8_formats(
|
||||||
|
m3u8_url, video_id, 'mp4', m3u8_id='hls', fatal=False))
|
||||||
|
for rendition in video_data.get('renditions', []):
|
||||||
|
video_url = rendition.get('url')
|
||||||
|
if not video_url:
|
||||||
|
continue
|
||||||
|
ext = rendition.get('format')
|
||||||
|
if ext == 'm3u8':
|
||||||
|
formats.extend(self._extract_m3u8_formats(
|
||||||
|
video_url, video_id, 'mp4', m3u8_id='hls', fatal=False))
|
||||||
|
else:
|
||||||
|
f = {
|
||||||
|
'url': video_url,
|
||||||
|
'format_id': rendition.get('quality'),
|
||||||
|
}
|
||||||
|
mobj = re.search(r'(\d+)x(\d+)', video_url)
|
||||||
|
if mobj:
|
||||||
|
f.update({
|
||||||
|
'width': int(mobj.group(1)),
|
||||||
|
'height': int(mobj.group(2)),
|
||||||
|
})
|
||||||
|
formats.append(f)
|
||||||
|
self._sort_formats(formats, ('width', 'height', 'tbr', 'format_id'))
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': video_data['title'],
|
||||||
|
'duration': int_or_none(video_data.get('duration')),
|
||||||
|
'timestamp': int_or_none(video_data.get('publishDate')),
|
||||||
|
'view_count': int_or_none(video_data.get('views')),
|
||||||
|
'description': video_data.get('description'),
|
||||||
|
'uploader': video_data.get('videoOwner'),
|
||||||
|
'formats': formats,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class AolFeaturesIE(InfoExtractor):
|
class AolFeaturesIE(InfoExtractor):
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ from .common import InfoExtractor
|
|||||||
from ..compat import compat_urlparse
|
from ..compat import compat_urlparse
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
int_or_none,
|
int_or_none,
|
||||||
|
parse_duration,
|
||||||
|
unified_strdate,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -16,7 +18,8 @@ class AppleTrailersIE(InfoExtractor):
|
|||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://trailers.apple.com/trailers/wb/manofsteel/',
|
'url': 'http://trailers.apple.com/trailers/wb/manofsteel/',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'manofsteel',
|
'id': '5111',
|
||||||
|
'title': 'Man of Steel',
|
||||||
},
|
},
|
||||||
'playlist': [
|
'playlist': [
|
||||||
{
|
{
|
||||||
@@ -70,6 +73,15 @@ class AppleTrailersIE(InfoExtractor):
|
|||||||
'id': 'blackthorn',
|
'id': 'blackthorn',
|
||||||
},
|
},
|
||||||
'playlist_mincount': 2,
|
'playlist_mincount': 2,
|
||||||
|
'expected_warnings': ['Unable to download JSON metadata'],
|
||||||
|
}, {
|
||||||
|
# json data only available from http://trailers.apple.com/trailers/feeds/data/15881.json
|
||||||
|
'url': 'http://trailers.apple.com/trailers/fox/kungfupanda3/',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '15881',
|
||||||
|
'title': 'Kung Fu Panda 3',
|
||||||
|
},
|
||||||
|
'playlist_mincount': 4,
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://trailers.apple.com/ca/metropole/autrui/',
|
'url': 'http://trailers.apple.com/ca/metropole/autrui/',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
@@ -85,6 +97,45 @@ class AppleTrailersIE(InfoExtractor):
|
|||||||
movie = mobj.group('movie')
|
movie = mobj.group('movie')
|
||||||
uploader_id = mobj.group('company')
|
uploader_id = mobj.group('company')
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, movie)
|
||||||
|
film_id = self._search_regex(r"FilmId\s*=\s*'(\d+)'", webpage, 'film id')
|
||||||
|
film_data = self._download_json(
|
||||||
|
'http://trailers.apple.com/trailers/feeds/data/%s.json' % film_id,
|
||||||
|
film_id, fatal=False)
|
||||||
|
|
||||||
|
if film_data:
|
||||||
|
entries = []
|
||||||
|
for clip in film_data.get('clips', []):
|
||||||
|
clip_title = clip['title']
|
||||||
|
|
||||||
|
formats = []
|
||||||
|
for version, version_data in clip.get('versions', {}).items():
|
||||||
|
for size, size_data in version_data.get('sizes', {}).items():
|
||||||
|
src = size_data.get('src')
|
||||||
|
if not src:
|
||||||
|
continue
|
||||||
|
formats.append({
|
||||||
|
'format_id': '%s-%s' % (version, size),
|
||||||
|
'url': re.sub(r'_(\d+p.mov)', r'_h\1', src),
|
||||||
|
'width': int_or_none(size_data.get('width')),
|
||||||
|
'height': int_or_none(size_data.get('height')),
|
||||||
|
'language': version[:2],
|
||||||
|
})
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
entries.append({
|
||||||
|
'id': movie + '-' + re.sub(r'[^a-zA-Z0-9]', '', clip_title).lower(),
|
||||||
|
'formats': formats,
|
||||||
|
'title': clip_title,
|
||||||
|
'thumbnail': clip.get('screen') or clip.get('thumb'),
|
||||||
|
'duration': parse_duration(clip.get('runtime') or clip.get('faded')),
|
||||||
|
'upload_date': unified_strdate(clip.get('posted')),
|
||||||
|
'uploader_id': uploader_id,
|
||||||
|
})
|
||||||
|
|
||||||
|
page_data = film_data.get('page', {})
|
||||||
|
return self.playlist_result(entries, film_id, page_data.get('movie_title'))
|
||||||
|
|
||||||
playlist_url = compat_urlparse.urljoin(url, 'includes/playlists/itunes.inc')
|
playlist_url = compat_urlparse.urljoin(url, 'includes/playlists/itunes.inc')
|
||||||
|
|
||||||
def fix_html(s):
|
def fix_html(s):
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ from .generic import GenericIE
|
|||||||
from ..utils import (
|
from ..utils import (
|
||||||
determine_ext,
|
determine_ext,
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
get_element_by_attribute,
|
|
||||||
qualities,
|
qualities,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
parse_duration,
|
parse_duration,
|
||||||
@@ -83,7 +82,7 @@ class ARDMediathekIE(InfoExtractor):
|
|||||||
subtitle_url = media_info.get('_subtitleUrl')
|
subtitle_url = media_info.get('_subtitleUrl')
|
||||||
if subtitle_url:
|
if subtitle_url:
|
||||||
subtitles['de'] = [{
|
subtitles['de'] = [{
|
||||||
'ext': 'srt',
|
'ext': 'ttml',
|
||||||
'url': subtitle_url,
|
'url': subtitle_url,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
@@ -274,41 +273,3 @@ class ARDIE(InfoExtractor):
|
|||||||
'upload_date': upload_date,
|
'upload_date': upload_date,
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': thumbnail,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class SportschauIE(ARDMediathekIE):
|
|
||||||
IE_NAME = 'Sportschau'
|
|
||||||
_VALID_URL = r'(?P<baseurl>https?://(?:www\.)?sportschau\.de/(?:[^/]+/)+video(?P<id>[^/#?]+))\.html'
|
|
||||||
_TESTS = [{
|
|
||||||
'url': 'http://www.sportschau.de/tourdefrance/videoseppeltkokainhatnichtsmitklassischemdopingzutun100.html',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'seppeltkokainhatnichtsmitklassischemdopingzutun100',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'Seppelt: "Kokain hat nichts mit klassischem Doping zu tun"',
|
|
||||||
'thumbnail': 're:^https?://.*\.jpg$',
|
|
||||||
'description': 'Der ARD-Doping Experte Hajo Seppelt gibt seine Einschätzung zum ersten Dopingfall der diesjährigen Tour de France um den Italiener Luca Paolini ab.',
|
|
||||||
},
|
|
||||||
'params': {
|
|
||||||
# m3u8 download
|
|
||||||
'skip_download': True,
|
|
||||||
},
|
|
||||||
}]
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
mobj = re.match(self._VALID_URL, url)
|
|
||||||
video_id = mobj.group('id')
|
|
||||||
base_url = mobj.group('baseurl')
|
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
|
||||||
title = get_element_by_attribute('class', 'headline', webpage)
|
|
||||||
description = self._html_search_meta('description', webpage, 'description')
|
|
||||||
|
|
||||||
info = self._extract_media_info(
|
|
||||||
base_url + '-mc_defaultQuality-h.json', webpage, video_id)
|
|
||||||
|
|
||||||
info.update({
|
|
||||||
'title': title,
|
|
||||||
'description': description,
|
|
||||||
})
|
|
||||||
|
|
||||||
return info
|
|
||||||
|
|||||||
@@ -61,10 +61,7 @@ class ArteTvIE(InfoExtractor):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class ArteTVPlus7IE(InfoExtractor):
|
class ArteTVBaseIE(InfoExtractor):
|
||||||
IE_NAME = 'arte.tv:+7'
|
|
||||||
_VALID_URL = r'https?://(?:www\.)?arte\.tv/guide/(?P<lang>fr|de|en|es)/(?:(?:sendungen|emissions|embed)/)?(?P<id>[^/]+)/(?P<name>[^/?#&+])'
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _extract_url_info(cls, url):
|
def _extract_url_info(cls, url):
|
||||||
mobj = re.match(cls._VALID_URL, url)
|
mobj = re.match(cls._VALID_URL, url)
|
||||||
@@ -78,6 +75,125 @@ class ArteTVPlus7IE(InfoExtractor):
|
|||||||
video_id = mobj.group('id')
|
video_id = mobj.group('id')
|
||||||
return video_id, lang
|
return video_id, lang
|
||||||
|
|
||||||
|
def _extract_from_json_url(self, json_url, video_id, lang, title=None):
|
||||||
|
info = self._download_json(json_url, video_id)
|
||||||
|
player_info = info['videoJsonPlayer']
|
||||||
|
|
||||||
|
upload_date_str = player_info.get('shootingDate')
|
||||||
|
if not upload_date_str:
|
||||||
|
upload_date_str = (player_info.get('VRA') or player_info.get('VDA') or '').split(' ')[0]
|
||||||
|
|
||||||
|
title = (player_info.get('VTI') or title or player_info['VID']).strip()
|
||||||
|
subtitle = player_info.get('VSU', '').strip()
|
||||||
|
if subtitle:
|
||||||
|
title += ' - %s' % subtitle
|
||||||
|
|
||||||
|
info_dict = {
|
||||||
|
'id': player_info['VID'],
|
||||||
|
'title': title,
|
||||||
|
'description': player_info.get('VDE'),
|
||||||
|
'upload_date': unified_strdate(upload_date_str),
|
||||||
|
'thumbnail': player_info.get('programImage') or player_info.get('VTU', {}).get('IUR'),
|
||||||
|
}
|
||||||
|
qfunc = qualities(['HQ', 'MQ', 'EQ', 'SQ'])
|
||||||
|
|
||||||
|
LANGS = {
|
||||||
|
'fr': 'F',
|
||||||
|
'de': 'A',
|
||||||
|
'en': 'E[ANG]',
|
||||||
|
'es': 'E[ESP]',
|
||||||
|
}
|
||||||
|
|
||||||
|
langcode = LANGS.get(lang, lang)
|
||||||
|
|
||||||
|
formats = []
|
||||||
|
for format_id, format_dict in player_info['VSR'].items():
|
||||||
|
f = dict(format_dict)
|
||||||
|
versionCode = f.get('versionCode')
|
||||||
|
l = re.escape(langcode)
|
||||||
|
|
||||||
|
# Language preference from most to least priority
|
||||||
|
# Reference: section 5.6.3 of
|
||||||
|
# http://www.arte.tv/sites/en/corporate/files/complete-technical-guidelines-arte-geie-v1-05.pdf
|
||||||
|
PREFERENCES = (
|
||||||
|
# original version in requested language, without subtitles
|
||||||
|
r'VO{0}$'.format(l),
|
||||||
|
# original version in requested language, with partial subtitles in requested language
|
||||||
|
r'VO{0}-ST{0}$'.format(l),
|
||||||
|
# original version in requested language, with subtitles for the deaf and hard-of-hearing in requested language
|
||||||
|
r'VO{0}-STM{0}$'.format(l),
|
||||||
|
# non-original (dubbed) version in requested language, without subtitles
|
||||||
|
r'V{0}$'.format(l),
|
||||||
|
# non-original (dubbed) version in requested language, with subtitles partial subtitles in requested language
|
||||||
|
r'V{0}-ST{0}$'.format(l),
|
||||||
|
# non-original (dubbed) version in requested language, with subtitles for the deaf and hard-of-hearing in requested language
|
||||||
|
r'V{0}-STM{0}$'.format(l),
|
||||||
|
# original version in requested language, with partial subtitles in different language
|
||||||
|
r'VO{0}-ST(?!{0}).+?$'.format(l),
|
||||||
|
# original version in requested language, with subtitles for the deaf and hard-of-hearing in different language
|
||||||
|
r'VO{0}-STM(?!{0}).+?$'.format(l),
|
||||||
|
# original version in different language, with partial subtitles in requested language
|
||||||
|
r'VO(?:(?!{0}).+?)?-ST{0}$'.format(l),
|
||||||
|
# original version in different language, with subtitles for the deaf and hard-of-hearing in requested language
|
||||||
|
r'VO(?:(?!{0}).+?)?-STM{0}$'.format(l),
|
||||||
|
# original version in different language, without subtitles
|
||||||
|
r'VO(?:(?!{0}))?$'.format(l),
|
||||||
|
# original version in different language, with partial subtitles in different language
|
||||||
|
r'VO(?:(?!{0}).+?)?-ST(?!{0}).+?$'.format(l),
|
||||||
|
# original version in different language, with subtitles for the deaf and hard-of-hearing in different language
|
||||||
|
r'VO(?:(?!{0}).+?)?-STM(?!{0}).+?$'.format(l),
|
||||||
|
)
|
||||||
|
|
||||||
|
for pref, p in enumerate(PREFERENCES):
|
||||||
|
if re.match(p, versionCode):
|
||||||
|
lang_pref = len(PREFERENCES) - pref
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
lang_pref = -1
|
||||||
|
|
||||||
|
format = {
|
||||||
|
'format_id': format_id,
|
||||||
|
'preference': -10 if f.get('videoFormat') == 'M3U8' else None,
|
||||||
|
'language_preference': lang_pref,
|
||||||
|
'format_note': '%s, %s' % (f.get('versionCode'), f.get('versionLibelle')),
|
||||||
|
'width': int_or_none(f.get('width')),
|
||||||
|
'height': int_or_none(f.get('height')),
|
||||||
|
'tbr': int_or_none(f.get('bitrate')),
|
||||||
|
'quality': qfunc(f.get('quality')),
|
||||||
|
}
|
||||||
|
|
||||||
|
if f.get('mediaType') == 'rtmp':
|
||||||
|
format['url'] = f['streamer']
|
||||||
|
format['play_path'] = 'mp4:' + f['url']
|
||||||
|
format['ext'] = 'flv'
|
||||||
|
else:
|
||||||
|
format['url'] = f['url']
|
||||||
|
|
||||||
|
formats.append(format)
|
||||||
|
|
||||||
|
self._check_formats(formats, video_id)
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
info_dict['formats'] = formats
|
||||||
|
return info_dict
|
||||||
|
|
||||||
|
|
||||||
|
class ArteTVPlus7IE(ArteTVBaseIE):
|
||||||
|
IE_NAME = 'arte.tv:+7'
|
||||||
|
_VALID_URL = r'https?://(?:(?:www|sites)\.)?arte\.tv/[^/]+/(?P<lang>fr|de|en|es)/(?:[^/]+/)*(?P<id>[^/?#&]+)'
|
||||||
|
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://www.arte.tv/guide/de/sendungen/XEN/xenius/?vid=055918-015_PLUS7-D',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'http://sites.arte.tv/karambolage/de/video/karambolage-22',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def suitable(cls, url):
|
||||||
|
return False if ArteTVPlaylistIE.suitable(url) else super(ArteTVPlus7IE, cls).suitable(url)
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id, lang = self._extract_url_info(url)
|
video_id, lang = self._extract_url_info(url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
@@ -127,108 +243,47 @@ class ArteTVPlus7IE(InfoExtractor):
|
|||||||
return self._extract_from_json_url(json_url, video_id, lang, title=title)
|
return self._extract_from_json_url(json_url, video_id, lang, title=title)
|
||||||
# Different kind of embed URL (e.g.
|
# Different kind of embed URL (e.g.
|
||||||
# http://www.arte.tv/magazine/trepalium/fr/episode-0406-replay-trepalium)
|
# http://www.arte.tv/magazine/trepalium/fr/episode-0406-replay-trepalium)
|
||||||
embed_url = self._search_regex(
|
entries = [
|
||||||
r'<iframe[^>]+src=(["\'])(?P<url>.+?)\1',
|
self.url_result(url)
|
||||||
webpage, 'embed url', group='url')
|
for _, url in re.findall(r'<iframe[^>]+src=(["\'])(?P<url>.+?)\1', webpage)]
|
||||||
return self.url_result(embed_url)
|
return self.playlist_result(entries)
|
||||||
|
|
||||||
def _extract_from_json_url(self, json_url, video_id, lang, title=None):
|
|
||||||
info = self._download_json(json_url, video_id)
|
|
||||||
player_info = info['videoJsonPlayer']
|
|
||||||
|
|
||||||
upload_date_str = player_info.get('shootingDate')
|
|
||||||
if not upload_date_str:
|
|
||||||
upload_date_str = (player_info.get('VRA') or player_info.get('VDA') or '').split(' ')[0]
|
|
||||||
|
|
||||||
title = (player_info.get('VTI') or title or player_info['VID']).strip()
|
|
||||||
subtitle = player_info.get('VSU', '').strip()
|
|
||||||
if subtitle:
|
|
||||||
title += ' - %s' % subtitle
|
|
||||||
|
|
||||||
info_dict = {
|
|
||||||
'id': player_info['VID'],
|
|
||||||
'title': title,
|
|
||||||
'description': player_info.get('VDE'),
|
|
||||||
'upload_date': unified_strdate(upload_date_str),
|
|
||||||
'thumbnail': player_info.get('programImage') or player_info.get('VTU', {}).get('IUR'),
|
|
||||||
}
|
|
||||||
qfunc = qualities(['HQ', 'MQ', 'EQ', 'SQ'])
|
|
||||||
|
|
||||||
LANGS = {
|
|
||||||
'fr': 'F',
|
|
||||||
'de': 'A',
|
|
||||||
'en': 'E[ANG]',
|
|
||||||
'es': 'E[ESP]',
|
|
||||||
}
|
|
||||||
|
|
||||||
formats = []
|
|
||||||
for format_id, format_dict in player_info['VSR'].items():
|
|
||||||
f = dict(format_dict)
|
|
||||||
versionCode = f.get('versionCode')
|
|
||||||
langcode = LANGS.get(lang, lang)
|
|
||||||
lang_rexs = [r'VO?%s-' % re.escape(langcode), r'VO?.-ST%s$' % re.escape(langcode)]
|
|
||||||
lang_pref = None
|
|
||||||
if versionCode:
|
|
||||||
matched_lang_rexs = [r for r in lang_rexs if re.match(r, versionCode)]
|
|
||||||
lang_pref = -10 if not matched_lang_rexs else 10 * len(matched_lang_rexs)
|
|
||||||
source_pref = 0
|
|
||||||
if versionCode is not None:
|
|
||||||
# The original version with subtitles has lower relevance
|
|
||||||
if re.match(r'VO-ST(F|A|E)', versionCode):
|
|
||||||
source_pref -= 10
|
|
||||||
# The version with sourds/mal subtitles has also lower relevance
|
|
||||||
elif re.match(r'VO?(F|A|E)-STM\1', versionCode):
|
|
||||||
source_pref -= 9
|
|
||||||
format = {
|
|
||||||
'format_id': format_id,
|
|
||||||
'preference': -10 if f.get('videoFormat') == 'M3U8' else None,
|
|
||||||
'language_preference': lang_pref,
|
|
||||||
'format_note': '%s, %s' % (f.get('versionCode'), f.get('versionLibelle')),
|
|
||||||
'width': int_or_none(f.get('width')),
|
|
||||||
'height': int_or_none(f.get('height')),
|
|
||||||
'tbr': int_or_none(f.get('bitrate')),
|
|
||||||
'quality': qfunc(f.get('quality')),
|
|
||||||
'source_preference': source_pref,
|
|
||||||
}
|
|
||||||
|
|
||||||
if f.get('mediaType') == 'rtmp':
|
|
||||||
format['url'] = f['streamer']
|
|
||||||
format['play_path'] = 'mp4:' + f['url']
|
|
||||||
format['ext'] = 'flv'
|
|
||||||
else:
|
|
||||||
format['url'] = f['url']
|
|
||||||
|
|
||||||
formats.append(format)
|
|
||||||
|
|
||||||
self._check_formats(formats, video_id)
|
|
||||||
self._sort_formats(formats)
|
|
||||||
|
|
||||||
info_dict['formats'] = formats
|
|
||||||
return info_dict
|
|
||||||
|
|
||||||
|
|
||||||
# It also uses the arte_vp_url url from the webpage to extract the information
|
# It also uses the arte_vp_url url from the webpage to extract the information
|
||||||
class ArteTVCreativeIE(ArteTVPlus7IE):
|
class ArteTVCreativeIE(ArteTVPlus7IE):
|
||||||
IE_NAME = 'arte.tv:creative'
|
IE_NAME = 'arte.tv:creative'
|
||||||
_VALID_URL = r'https?://creative\.arte\.tv/(?P<lang>fr|de|en|es)/(?:magazine?/)?(?P<id>[^/?#&]+)'
|
_VALID_URL = r'https?://creative\.arte\.tv/(?P<lang>fr|de|en|es)/(?:[^/]+/)*(?P<id>[^/?#&]+)'
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://creative.arte.tv/de/magazin/agentur-amateur-corporate-design',
|
'url': 'http://creative.arte.tv/fr/episode/osmosis-episode-1',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '72176',
|
'id': '057405-001-A',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Folge 2 - Corporate Design',
|
'title': 'OSMOSIS - N\'AYEZ PLUS PEUR D\'AIMER (1)',
|
||||||
'upload_date': '20131004',
|
'upload_date': '20150716',
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://creative.arte.tv/fr/Monty-Python-Reunion',
|
'url': 'http://creative.arte.tv/fr/Monty-Python-Reunion',
|
||||||
|
'playlist_count': 11,
|
||||||
|
'add_ie': ['Youtube'],
|
||||||
|
}, {
|
||||||
|
'url': 'http://creative.arte.tv/de/episode/agentur-amateur-4-der-erste-kunde',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
|
||||||
|
class ArteTVInfoIE(ArteTVPlus7IE):
|
||||||
|
IE_NAME = 'arte.tv:info'
|
||||||
|
_VALID_URL = r'https?://info\.arte\.tv/(?P<lang>fr|de|en|es)/(?:[^/]+/)*(?P<id>[^/?#&]+)'
|
||||||
|
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://info.arte.tv/fr/service-civique-un-cache-misere',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '160676',
|
'id': '067528-000-A',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Monty Python live (mostly)',
|
'title': 'Service civique, un cache misère ?',
|
||||||
'description': 'Événement ! Quarante-cinq ans après leurs premiers succès, les légendaires Monty Python remontent sur scène.\n',
|
'upload_date': '20160403',
|
||||||
'upload_date': '20140805',
|
},
|
||||||
}
|
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
|
||||||
@@ -254,6 +309,8 @@ class ArteTVDDCIE(ArteTVPlus7IE):
|
|||||||
IE_NAME = 'arte.tv:ddc'
|
IE_NAME = 'arte.tv:ddc'
|
||||||
_VALID_URL = r'https?://ddc\.arte\.tv/(?P<lang>emission|folge)/(?P<id>[^/?#&]+)'
|
_VALID_URL = r'https?://ddc\.arte\.tv/(?P<lang>emission|folge)/(?P<id>[^/?#&]+)'
|
||||||
|
|
||||||
|
_TESTS = []
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id, lang = self._extract_url_info(url)
|
video_id, lang = self._extract_url_info(url)
|
||||||
if lang == 'folge':
|
if lang == 'folge':
|
||||||
@@ -272,7 +329,7 @@ class ArteTVConcertIE(ArteTVPlus7IE):
|
|||||||
IE_NAME = 'arte.tv:concert'
|
IE_NAME = 'arte.tv:concert'
|
||||||
_VALID_URL = r'https?://concert\.arte\.tv/(?P<lang>fr|de|en|es)/(?P<id>[^/?#&]+)'
|
_VALID_URL = r'https?://concert\.arte\.tv/(?P<lang>fr|de|en|es)/(?P<id>[^/?#&]+)'
|
||||||
|
|
||||||
_TEST = {
|
_TESTS = [{
|
||||||
'url': 'http://concert.arte.tv/de/notwist-im-pariser-konzertclub-divan-du-monde',
|
'url': 'http://concert.arte.tv/de/notwist-im-pariser-konzertclub-divan-du-monde',
|
||||||
'md5': '9ea035b7bd69696b67aa2ccaaa218161',
|
'md5': '9ea035b7bd69696b67aa2ccaaa218161',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
@@ -282,24 +339,23 @@ class ArteTVConcertIE(ArteTVPlus7IE):
|
|||||||
'upload_date': '20140128',
|
'upload_date': '20140128',
|
||||||
'description': 'md5:486eb08f991552ade77439fe6d82c305',
|
'description': 'md5:486eb08f991552ade77439fe6d82c305',
|
||||||
},
|
},
|
||||||
}
|
}]
|
||||||
|
|
||||||
|
|
||||||
class ArteTVCinemaIE(ArteTVPlus7IE):
|
class ArteTVCinemaIE(ArteTVPlus7IE):
|
||||||
IE_NAME = 'arte.tv:cinema'
|
IE_NAME = 'arte.tv:cinema'
|
||||||
_VALID_URL = r'https?://cinema\.arte\.tv/(?P<lang>fr|de|en|es)/(?P<id>.+)'
|
_VALID_URL = r'https?://cinema\.arte\.tv/(?P<lang>fr|de|en|es)/(?P<id>.+)'
|
||||||
|
|
||||||
_TEST = {
|
_TESTS = [{
|
||||||
'url': 'http://cinema.arte.tv/de/node/38291',
|
'url': 'http://cinema.arte.tv/fr/article/les-ailes-du-desir-de-julia-reck',
|
||||||
'md5': '6b275511a5107c60bacbeeda368c3aa1',
|
'md5': 'a5b9dd5575a11d93daf0e3f404f45438',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '055876-000_PWA12025-D',
|
'id': '062494-000-A',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Tod auf dem Nil',
|
'title': 'Film lauréat du concours web - "Les ailes du désir" de Julia Reck',
|
||||||
'upload_date': '20160122',
|
'upload_date': '20150807',
|
||||||
'description': 'md5:7f749bbb77d800ef2be11d54529b96bc',
|
|
||||||
},
|
},
|
||||||
}
|
}]
|
||||||
|
|
||||||
|
|
||||||
class ArteTVMagazineIE(ArteTVPlus7IE):
|
class ArteTVMagazineIE(ArteTVPlus7IE):
|
||||||
@@ -337,16 +393,49 @@ class ArteTVEmbedIE(ArteTVPlus7IE):
|
|||||||
IE_NAME = 'arte.tv:embed'
|
IE_NAME = 'arte.tv:embed'
|
||||||
_VALID_URL = r'''(?x)
|
_VALID_URL = r'''(?x)
|
||||||
http://www\.arte\.tv
|
http://www\.arte\.tv
|
||||||
/playerv2/embed\.php\?json_url=
|
/(?:playerv2/embed|arte_vp/index)\.php\?json_url=
|
||||||
(?P<json_url>
|
(?P<json_url>
|
||||||
http://arte\.tv/papi/tvguide/videos/stream/player/
|
http://arte\.tv/papi/tvguide/videos/stream/player/
|
||||||
(?P<lang>[^/]+)/(?P<id>[^/]+)[^&]*
|
(?P<lang>[^/]+)/(?P<id>[^/]+)[^&]*
|
||||||
)
|
)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
_TESTS = []
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
video_id = mobj.group('id')
|
video_id = mobj.group('id')
|
||||||
lang = mobj.group('lang')
|
lang = mobj.group('lang')
|
||||||
json_url = mobj.group('json_url')
|
json_url = mobj.group('json_url')
|
||||||
return self._extract_from_json_url(json_url, video_id, lang)
|
return self._extract_from_json_url(json_url, video_id, lang)
|
||||||
|
|
||||||
|
|
||||||
|
class ArteTVPlaylistIE(ArteTVBaseIE):
|
||||||
|
IE_NAME = 'arte.tv:playlist'
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?arte\.tv/guide/(?P<lang>fr|de|en|es)/[^#]*#collection/(?P<id>PL-\d+)'
|
||||||
|
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://www.arte.tv/guide/de/plus7/?country=DE#collection/PL-013263/ARTETV',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'PL-013263',
|
||||||
|
'title': 'Areva & Uramin',
|
||||||
|
'description': 'md5:a1dc0312ce357c262259139cfd48c9bf',
|
||||||
|
},
|
||||||
|
'playlist_mincount': 6,
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.arte.tv/guide/de/playlists?country=DE#collection/PL-013190/ARTETV',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
playlist_id, lang = self._extract_url_info(url)
|
||||||
|
collection = self._download_json(
|
||||||
|
'https://api.arte.tv/api/player/v1/collectionData/%s/%s?source=videos'
|
||||||
|
% (lang, playlist_id), playlist_id)
|
||||||
|
title = collection.get('title')
|
||||||
|
description = collection.get('shortDescription') or collection.get('teaserText')
|
||||||
|
entries = [
|
||||||
|
self._extract_from_json_url(
|
||||||
|
video['jsonUrl'], video.get('programId') or playlist_id, lang)
|
||||||
|
for video in collection['videos'] if video.get('jsonUrl')]
|
||||||
|
return self.playlist_result(entries, playlist_id, title, description)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import time
|
|||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from .soundcloud import SoundcloudIE
|
from .soundcloud import SoundcloudIE
|
||||||
|
from ..compat import compat_str
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
url_basename,
|
url_basename,
|
||||||
@@ -30,14 +31,14 @@ class AudiomackIE(InfoExtractor):
|
|||||||
# audiomack wrapper around soundcloud song
|
# audiomack wrapper around soundcloud song
|
||||||
{
|
{
|
||||||
'add_ie': ['Soundcloud'],
|
'add_ie': ['Soundcloud'],
|
||||||
'url': 'http://www.audiomack.com/song/xclusiveszone/take-kare',
|
'url': 'http://www.audiomack.com/song/hip-hop-daily/black-mamba-freestyle',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '172419696',
|
'id': '258901379',
|
||||||
'ext': 'mp3',
|
'ext': 'mp3',
|
||||||
'description': 'md5:1fc3272ed7a635cce5be1568c2822997',
|
'description': 'mamba day freestyle for the legend Kobe Bryant ',
|
||||||
'title': 'Young Thug ft Lil Wayne - Take Kare',
|
'title': 'Black Mamba Freestyle [Prod. By Danny Wolf]',
|
||||||
'uploader': 'Young Thug World',
|
'uploader': 'ILOVEMAKONNEN',
|
||||||
'upload_date': '20141016',
|
'upload_date': '20160414',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -136,7 +137,7 @@ class AudiomackAlbumIE(InfoExtractor):
|
|||||||
result[resultkey] = api_response[apikey]
|
result[resultkey] = api_response[apikey]
|
||||||
song_id = url_basename(api_response['url']).rpartition('.')[0]
|
song_id = url_basename(api_response['url']).rpartition('.')[0]
|
||||||
result['entries'].append({
|
result['entries'].append({
|
||||||
'id': api_response.get('id', song_id),
|
'id': compat_str(api_response.get('id', song_id)),
|
||||||
'uploader': api_response.get('artist'),
|
'uploader': api_response.get('artist'),
|
||||||
'title': api_response.get('title', song_id),
|
'title': api_response.get('title', song_id),
|
||||||
'url': api_response['url'],
|
'url': api_response['url'],
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ class AzubuIE(InfoExtractor):
|
|||||||
'uploader_id': 272749,
|
'uploader_id': 272749,
|
||||||
'view_count': int,
|
'view_count': int,
|
||||||
},
|
},
|
||||||
|
'skip': 'Channel offline',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -56,22 +57,26 @@ class AzubuIE(InfoExtractor):
|
|||||||
'http://www.azubu.tv/api/video/%s' % video_id, video_id)['data']
|
'http://www.azubu.tv/api/video/%s' % video_id, video_id)['data']
|
||||||
|
|
||||||
title = data['title'].strip()
|
title = data['title'].strip()
|
||||||
description = data['description']
|
description = data.get('description')
|
||||||
thumbnail = data['thumbnail']
|
thumbnail = data.get('thumbnail')
|
||||||
view_count = data['view_count']
|
view_count = data.get('view_count')
|
||||||
uploader = data['user']['username']
|
user = data.get('user', {})
|
||||||
uploader_id = data['user']['id']
|
uploader = user.get('username')
|
||||||
|
uploader_id = user.get('id')
|
||||||
|
|
||||||
stream_params = json.loads(data['stream_params'])
|
stream_params = json.loads(data['stream_params'])
|
||||||
|
|
||||||
timestamp = float_or_none(stream_params['creationDate'], 1000)
|
timestamp = float_or_none(stream_params.get('creationDate'), 1000)
|
||||||
duration = float_or_none(stream_params['length'], 1000)
|
duration = float_or_none(stream_params.get('length'), 1000)
|
||||||
|
|
||||||
renditions = stream_params.get('renditions') or []
|
renditions = stream_params.get('renditions') or []
|
||||||
video = stream_params.get('FLVFullLength') or stream_params.get('videoFullLength')
|
video = stream_params.get('FLVFullLength') or stream_params.get('videoFullLength')
|
||||||
if video:
|
if video:
|
||||||
renditions.append(video)
|
renditions.append(video)
|
||||||
|
|
||||||
|
if not renditions and not user.get('channel', {}).get('is_live', True):
|
||||||
|
raise ExtractorError('%s said: channel is offline.' % self.IE_NAME, expected=True)
|
||||||
|
|
||||||
formats = [{
|
formats = [{
|
||||||
'url': fmt['url'],
|
'url': fmt['url'],
|
||||||
'width': fmt['frameWidth'],
|
'width': fmt['frameWidth'],
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class BandcampIE(InfoExtractor):
|
|||||||
'_skip': 'There is a limit of 200 free downloads / month for the test song'
|
'_skip': 'There is a limit of 200 free downloads / month for the test song'
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://benprunty.bandcamp.com/track/lanius-battle',
|
'url': 'http://benprunty.bandcamp.com/track/lanius-battle',
|
||||||
'md5': '2b68e5851514c20efdff2afc5603b8b4',
|
'md5': '73d0b3171568232574e45652f8720b5c',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '2650410135',
|
'id': '2650410135',
|
||||||
'ext': 'mp3',
|
'ext': 'mp3',
|
||||||
@@ -48,6 +48,10 @@ class BandcampIE(InfoExtractor):
|
|||||||
if m_trackinfo:
|
if m_trackinfo:
|
||||||
json_code = m_trackinfo.group(1)
|
json_code = m_trackinfo.group(1)
|
||||||
data = json.loads(json_code)[0]
|
data = json.loads(json_code)[0]
|
||||||
|
track_id = compat_str(data['id'])
|
||||||
|
|
||||||
|
if not data.get('file'):
|
||||||
|
raise ExtractorError('Not streamable', video_id=track_id, expected=True)
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
for format_id, format_url in data['file'].items():
|
for format_id, format_url in data['file'].items():
|
||||||
@@ -64,7 +68,7 @@ class BandcampIE(InfoExtractor):
|
|||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': compat_str(data['id']),
|
'id': track_id,
|
||||||
'title': data['title'],
|
'title': data['title'],
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'duration': float_or_none(data.get('duration')),
|
'duration': float_or_none(data.get('duration')),
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class BBCCoUkIE(InfoExtractor):
|
|||||||
music/clips[/#]|
|
music/clips[/#]|
|
||||||
radio/player/
|
radio/player/
|
||||||
)
|
)
|
||||||
(?P<id>%s)
|
(?P<id>%s)(?!/(?:episodes|broadcasts|clips))
|
||||||
''' % _ID_REGEX
|
''' % _ID_REGEX
|
||||||
|
|
||||||
_MEDIASELECTOR_URLS = [
|
_MEDIASELECTOR_URLS = [
|
||||||
@@ -192,6 +192,7 @@ class BBCCoUkIE(InfoExtractor):
|
|||||||
# rtmp download
|
# rtmp download
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
|
'skip': 'Now it\'s really geo-restricted',
|
||||||
}, {
|
}, {
|
||||||
# compact player (https://github.com/rg3/youtube-dl/issues/8147)
|
# compact player (https://github.com/rg3/youtube-dl/issues/8147)
|
||||||
'url': 'http://www.bbc.co.uk/programmes/p028bfkf/player',
|
'url': 'http://www.bbc.co.uk/programmes/p028bfkf/player',
|
||||||
@@ -671,6 +672,7 @@ class BBCIE(BBCCoUkIE):
|
|||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '34475836',
|
'id': '34475836',
|
||||||
'title': 'Jurgen Klopp: Furious football from a witty and winning coach',
|
'title': 'Jurgen Klopp: Furious football from a witty and winning coach',
|
||||||
|
'description': 'Fast-paced football, wit, wisdom and a ready smile - why Liverpool fans should come to love new boss Jurgen Klopp.',
|
||||||
},
|
},
|
||||||
'playlist_count': 3,
|
'playlist_count': 3,
|
||||||
}, {
|
}, {
|
||||||
@@ -697,7 +699,9 @@ class BBCIE(BBCCoUkIE):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def suitable(cls, url):
|
def suitable(cls, url):
|
||||||
return False if BBCCoUkIE.suitable(url) or BBCCoUkArticleIE.suitable(url) else super(BBCIE, cls).suitable(url)
|
EXCLUDE_IE = (BBCCoUkIE, BBCCoUkArticleIE, BBCCoUkIPlayerPlaylistIE, BBCCoUkPlaylistIE)
|
||||||
|
return (False if any(ie.suitable(url) for ie in EXCLUDE_IE)
|
||||||
|
else super(BBCIE, cls).suitable(url))
|
||||||
|
|
||||||
def _extract_from_media_meta(self, media_meta, video_id):
|
def _extract_from_media_meta(self, media_meta, video_id):
|
||||||
# Direct links to media in media metadata (e.g.
|
# Direct links to media in media metadata (e.g.
|
||||||
@@ -974,3 +978,72 @@ class BBCCoUkArticleIE(InfoExtractor):
|
|||||||
r'<div[^>]+typeof="Clip"[^>]+resource="([^"]+)"', webpage)]
|
r'<div[^>]+typeof="Clip"[^>]+resource="([^"]+)"', webpage)]
|
||||||
|
|
||||||
return self.playlist_result(entries, playlist_id, title, description)
|
return self.playlist_result(entries, playlist_id, title, description)
|
||||||
|
|
||||||
|
|
||||||
|
class BBCCoUkPlaylistBaseIE(InfoExtractor):
|
||||||
|
def _real_extract(self, url):
|
||||||
|
playlist_id = self._match_id(url)
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, playlist_id)
|
||||||
|
|
||||||
|
entries = [
|
||||||
|
self.url_result(self._URL_TEMPLATE % video_id, BBCCoUkIE.ie_key())
|
||||||
|
for video_id in re.findall(
|
||||||
|
self._VIDEO_ID_TEMPLATE % BBCCoUkIE._ID_REGEX, webpage)]
|
||||||
|
|
||||||
|
title, description = self._extract_title_and_description(webpage)
|
||||||
|
|
||||||
|
return self.playlist_result(entries, playlist_id, title, description)
|
||||||
|
|
||||||
|
|
||||||
|
class BBCCoUkIPlayerPlaylistIE(BBCCoUkPlaylistBaseIE):
|
||||||
|
IE_NAME = 'bbc.co.uk:iplayer:playlist'
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?bbc\.co\.uk/iplayer/episodes/(?P<id>%s)' % BBCCoUkIE._ID_REGEX
|
||||||
|
_URL_TEMPLATE = 'http://www.bbc.co.uk/iplayer/episode/%s'
|
||||||
|
_VIDEO_ID_TEMPLATE = r'data-ip-id=["\'](%s)'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'http://www.bbc.co.uk/iplayer/episodes/b05rcz9v',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'b05rcz9v',
|
||||||
|
'title': 'The Disappearance',
|
||||||
|
'description': 'French thriller serial about a missing teenager.',
|
||||||
|
},
|
||||||
|
'playlist_mincount': 6,
|
||||||
|
}
|
||||||
|
|
||||||
|
def _extract_title_and_description(self, webpage):
|
||||||
|
title = self._search_regex(r'<h1>([^<]+)</h1>', webpage, 'title', fatal=False)
|
||||||
|
description = self._search_regex(
|
||||||
|
r'<p[^>]+class=(["\'])subtitle\1[^>]*>(?P<value>[^<]+)</p>',
|
||||||
|
webpage, 'description', fatal=False, group='value')
|
||||||
|
return title, description
|
||||||
|
|
||||||
|
|
||||||
|
class BBCCoUkPlaylistIE(BBCCoUkPlaylistBaseIE):
|
||||||
|
IE_NAME = 'bbc.co.uk:playlist'
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?bbc\.co\.uk/programmes/(?P<id>%s)/(?:episodes|broadcasts|clips)' % BBCCoUkIE._ID_REGEX
|
||||||
|
_URL_TEMPLATE = 'http://www.bbc.co.uk/programmes/%s'
|
||||||
|
_VIDEO_ID_TEMPLATE = r'data-pid=["\'](%s)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://www.bbc.co.uk/programmes/b05rcz9v/clips',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'b05rcz9v',
|
||||||
|
'title': 'The Disappearance - Clips - BBC Four',
|
||||||
|
'description': 'French thriller serial about a missing teenager.',
|
||||||
|
},
|
||||||
|
'playlist_mincount': 7,
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.bbc.co.uk/programmes/b05rcz9v/broadcasts/2016/06',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.bbc.co.uk/programmes/b05rcz9v/clips',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.bbc.co.uk/programmes/b055jkys/episodes/player',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _extract_title_and_description(self, webpage):
|
||||||
|
title = self._og_search_title(webpage, fatal=False)
|
||||||
|
description = self._og_search_description(webpage)
|
||||||
|
return title, description
|
||||||
|
|||||||
@@ -33,8 +33,33 @@ class BeegIE(InfoExtractor):
|
|||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
|
cpl_url = self._search_regex(
|
||||||
|
r'<script[^>]+src=(["\'])(?P<url>(?:https?:)?//static\.beeg\.com/cpl/\d+\.js.*?)\1',
|
||||||
|
webpage, 'cpl', default=None, group='url')
|
||||||
|
|
||||||
|
beeg_version, beeg_salt = [None] * 2
|
||||||
|
|
||||||
|
if cpl_url:
|
||||||
|
cpl = self._download_webpage(
|
||||||
|
self._proto_relative_url(cpl_url), video_id,
|
||||||
|
'Downloading cpl JS', fatal=False)
|
||||||
|
if cpl:
|
||||||
|
beeg_version = self._search_regex(
|
||||||
|
r'beeg_version\s*=\s*(\d+)', cpl,
|
||||||
|
'beeg version', default=None) or self._search_regex(
|
||||||
|
r'/(\d+)\.js', cpl_url, 'beeg version', default=None)
|
||||||
|
beeg_salt = self._search_regex(
|
||||||
|
r'beeg_salt\s*=\s*(["\'])(?P<beeg_salt>.+?)\1', cpl, 'beeg beeg_salt',
|
||||||
|
default=None, group='beeg_salt')
|
||||||
|
|
||||||
|
beeg_version = beeg_version or '1750'
|
||||||
|
beeg_salt = beeg_salt or 'MIDtGaw96f0N1kMMAM1DE46EC9pmFr'
|
||||||
|
|
||||||
video = self._download_json(
|
video = self._download_json(
|
||||||
'https://api.beeg.com/api/v6/1738/video/%s' % video_id, video_id)
|
'http://api.beeg.com/api/v6/%s/video/%s' % (beeg_version, video_id),
|
||||||
|
video_id)
|
||||||
|
|
||||||
def split(o, e):
|
def split(o, e):
|
||||||
def cut(s, x):
|
def cut(s, x):
|
||||||
@@ -51,7 +76,7 @@ class BeegIE(InfoExtractor):
|
|||||||
|
|
||||||
def decrypt_key(key):
|
def decrypt_key(key):
|
||||||
# Reverse engineered from http://static.beeg.com/cpl/1738.js
|
# Reverse engineered from http://static.beeg.com/cpl/1738.js
|
||||||
a = 'GUuyodcfS8FW8gQp4OKLMsZBcX0T7B'
|
a = beeg_salt
|
||||||
e = compat_urllib_parse_unquote(key)
|
e = compat_urllib_parse_unquote(key)
|
||||||
o = ''.join([
|
o = ''.join([
|
||||||
compat_chr(compat_ord(e[n]) - compat_ord(a[n % len(a)]) % 21)
|
compat_chr(compat_ord(e[n]) - compat_ord(a[n % len(a)]) % 21)
|
||||||
@@ -101,5 +126,5 @@ class BeegIE(InfoExtractor):
|
|||||||
'duration': duration,
|
'duration': duration,
|
||||||
'tags': tags,
|
'tags': tags,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'age_limit': 18,
|
'age_limit': self._rta_search(webpage),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,27 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .mtv import MTVServicesInfoExtractor
|
||||||
from ..compat import compat_urllib_parse_unquote
|
from ..utils import unified_strdate
|
||||||
from ..utils import (
|
from ..compat import compat_urllib_parse_urlencode
|
||||||
xpath_text,
|
|
||||||
xpath_with_ns,
|
|
||||||
int_or_none,
|
|
||||||
parse_iso8601,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BetIE(InfoExtractor):
|
class BetIE(MTVServicesInfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?bet\.com/(?:[^/]+/)+(?P<id>.+?)\.html'
|
_VALID_URL = r'https?://(?:www\.)?bet\.com/(?:[^/]+/)+(?P<id>.+?)\.html'
|
||||||
_TESTS = [
|
_TESTS = [
|
||||||
{
|
{
|
||||||
'url': 'http://www.bet.com/news/politics/2014/12/08/in-bet-exclusive-obama-talks-race-and-racism.html',
|
'url': 'http://www.bet.com/news/politics/2014/12/08/in-bet-exclusive-obama-talks-race-and-racism.html',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'news/national/2014/a-conversation-with-president-obama',
|
'id': '07e96bd3-8850-3051-b856-271b457f0ab8',
|
||||||
'display_id': 'in-bet-exclusive-obama-talks-race-and-racism',
|
'display_id': 'in-bet-exclusive-obama-talks-race-and-racism',
|
||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
'title': 'A Conversation With President Obama',
|
'title': 'A Conversation With President Obama',
|
||||||
'description': 'md5:699d0652a350cf3e491cd15cc745b5da',
|
'description': 'President Obama urges persistence in confronting racism and bias.',
|
||||||
'duration': 1534,
|
'duration': 1534,
|
||||||
'timestamp': 1418075340,
|
|
||||||
'upload_date': '20141208',
|
'upload_date': '20141208',
|
||||||
'uploader': 'admin',
|
|
||||||
'thumbnail': 're:(?i)^https?://.*\.jpg$',
|
'thumbnail': 're:(?i)^https?://.*\.jpg$',
|
||||||
|
'subtitles': {
|
||||||
|
'en': 'mincount:2',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'params': {
|
'params': {
|
||||||
# rtmp download
|
# rtmp download
|
||||||
@@ -35,16 +31,17 @@ class BetIE(InfoExtractor):
|
|||||||
{
|
{
|
||||||
'url': 'http://www.bet.com/video/news/national/2014/justice-for-ferguson-a-community-reacts.html',
|
'url': 'http://www.bet.com/video/news/national/2014/justice-for-ferguson-a-community-reacts.html',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'news/national/2014/justice-for-ferguson-a-community-reacts',
|
'id': '9f516bf1-7543-39c4-8076-dd441b459ba9',
|
||||||
'display_id': 'justice-for-ferguson-a-community-reacts',
|
'display_id': 'justice-for-ferguson-a-community-reacts',
|
||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
'title': 'Justice for Ferguson: A Community Reacts',
|
'title': 'Justice for Ferguson: A Community Reacts',
|
||||||
'description': 'A BET News special.',
|
'description': 'A BET News special.',
|
||||||
'duration': 1696,
|
'duration': 1696,
|
||||||
'timestamp': 1416942360,
|
|
||||||
'upload_date': '20141125',
|
'upload_date': '20141125',
|
||||||
'uploader': 'admin',
|
|
||||||
'thumbnail': 're:(?i)^https?://.*\.jpg$',
|
'thumbnail': 're:(?i)^https?://.*\.jpg$',
|
||||||
|
'subtitles': {
|
||||||
|
'en': 'mincount:2',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'params': {
|
'params': {
|
||||||
# rtmp download
|
# rtmp download
|
||||||
@@ -53,57 +50,32 @@ class BetIE(InfoExtractor):
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
_FEED_URL = "http://feeds.mtvnservices.com/od/feed/bet-mrss-player"
|
||||||
|
|
||||||
|
def _get_feed_query(self, uri):
|
||||||
|
return compat_urllib_parse_urlencode({
|
||||||
|
'uuid': uri,
|
||||||
|
})
|
||||||
|
|
||||||
|
def _extract_mgid(self, webpage):
|
||||||
|
return self._search_regex(r'data-uri="([^"]+)', webpage, 'mgid')
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
display_id = self._match_id(url)
|
display_id = self._match_id(url)
|
||||||
|
|
||||||
webpage = self._download_webpage(url, display_id)
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
mgid = self._extract_mgid(webpage)
|
||||||
|
videos_info = self._get_videos_info(mgid)
|
||||||
|
|
||||||
media_url = compat_urllib_parse_unquote(self._search_regex(
|
info_dict = videos_info['entries'][0]
|
||||||
[r'mediaURL\s*:\s*"([^"]+)"', r"var\s+mrssMediaUrl\s*=\s*'([^']+)'"],
|
|
||||||
webpage, 'media URL'))
|
|
||||||
|
|
||||||
video_id = self._search_regex(
|
upload_date = unified_strdate(self._html_search_meta('date', webpage))
|
||||||
r'/video/(.*)/_jcr_content/', media_url, 'video id')
|
description = self._html_search_meta('description', webpage)
|
||||||
|
|
||||||
mrss = self._download_xml(media_url, display_id)
|
info_dict.update({
|
||||||
|
|
||||||
item = mrss.find('./channel/item')
|
|
||||||
|
|
||||||
NS_MAP = {
|
|
||||||
'dc': 'http://purl.org/dc/elements/1.1/',
|
|
||||||
'media': 'http://search.yahoo.com/mrss/',
|
|
||||||
'ka': 'http://kickapps.com/karss',
|
|
||||||
}
|
|
||||||
|
|
||||||
title = xpath_text(item, './title', 'title')
|
|
||||||
description = xpath_text(
|
|
||||||
item, './description', 'description', fatal=False)
|
|
||||||
|
|
||||||
timestamp = parse_iso8601(xpath_text(
|
|
||||||
item, xpath_with_ns('./dc:date', NS_MAP),
|
|
||||||
'upload date', fatal=False))
|
|
||||||
uploader = xpath_text(
|
|
||||||
item, xpath_with_ns('./dc:creator', NS_MAP),
|
|
||||||
'uploader', fatal=False)
|
|
||||||
|
|
||||||
media_content = item.find(
|
|
||||||
xpath_with_ns('./media:content', NS_MAP))
|
|
||||||
duration = int_or_none(media_content.get('duration'))
|
|
||||||
smil_url = media_content.get('url')
|
|
||||||
|
|
||||||
thumbnail = media_content.find(
|
|
||||||
xpath_with_ns('./media:thumbnail', NS_MAP)).get('url')
|
|
||||||
|
|
||||||
formats = self._extract_smil_formats(smil_url, display_id)
|
|
||||||
self._sort_formats(formats)
|
|
||||||
|
|
||||||
return {
|
|
||||||
'id': video_id,
|
|
||||||
'display_id': display_id,
|
'display_id': display_id,
|
||||||
'title': title,
|
|
||||||
'description': description,
|
'description': description,
|
||||||
'thumbnail': thumbnail,
|
'upload_date': upload_date,
|
||||||
'timestamp': timestamp,
|
})
|
||||||
'uploader': uploader,
|
|
||||||
'duration': duration,
|
return info_dict
|
||||||
'formats': formats,
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,34 +1,42 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import calendar
|
||||||
|
import datetime
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import compat_str
|
from ..compat import (
|
||||||
|
compat_etree_fromstring,
|
||||||
|
compat_str,
|
||||||
|
compat_parse_qs,
|
||||||
|
compat_xml_parse_error,
|
||||||
|
)
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
int_or_none,
|
|
||||||
unescapeHTML,
|
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
|
int_or_none,
|
||||||
|
float_or_none,
|
||||||
xpath_text,
|
xpath_text,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class BiliBiliIE(InfoExtractor):
|
class BiliBiliIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://www\.bilibili\.(?:tv|com)/video/av(?P<id>\d+)(?:/index_(?P<page_num>\d+).html)?'
|
_VALID_URL = r'https?://www\.bilibili\.(?:tv|com)/video/av(?P<id>\d+)'
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://www.bilibili.tv/video/av1074402/',
|
'url': 'http://www.bilibili.tv/video/av1074402/',
|
||||||
'md5': '2c301e4dab317596e837c3e7633e7d86',
|
'md5': '5f7d29e1a2872f3df0cf76b1f87d3788',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '1554319',
|
'id': '1554319',
|
||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
'title': '【金坷垃】金泡沫',
|
'title': '【金坷垃】金泡沫',
|
||||||
'duration': 308313,
|
'description': 'md5:ce18c2a2d2193f0df2917d270f2e5923',
|
||||||
|
'duration': 308.067,
|
||||||
|
'timestamp': 1398012660,
|
||||||
'upload_date': '20140420',
|
'upload_date': '20140420',
|
||||||
'thumbnail': 're:^https?://.+\.jpg',
|
'thumbnail': 're:^https?://.+\.jpg',
|
||||||
'description': 'md5:ce18c2a2d2193f0df2917d270f2e5923',
|
|
||||||
'timestamp': 1397983878,
|
|
||||||
'uploader': '菊子桑',
|
'uploader': '菊子桑',
|
||||||
|
'uploader_id': '156160',
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.bilibili.com/video/av1041170/',
|
'url': 'http://www.bilibili.com/video/av1041170/',
|
||||||
@@ -36,75 +44,186 @@ class BiliBiliIE(InfoExtractor):
|
|||||||
'id': '1041170',
|
'id': '1041170',
|
||||||
'title': '【BD1080P】刀语【诸神&异域】',
|
'title': '【BD1080P】刀语【诸神&异域】',
|
||||||
'description': '这是个神奇的故事~每个人不留弹幕不给走哦~切利哦!~',
|
'description': '这是个神奇的故事~每个人不留弹幕不给走哦~切利哦!~',
|
||||||
'uploader': '枫叶逝去',
|
|
||||||
'timestamp': 1396501299,
|
|
||||||
},
|
},
|
||||||
'playlist_count': 9,
|
'playlist_count': 9,
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.bilibili.com/video/av4808130/',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '4808130',
|
||||||
|
'title': '【长篇】哆啦A梦443【钉铛】',
|
||||||
|
'description': '(2016.05.27)来组合客人的脸吧&amp;寻母六千里锭 抱歉,又轮到周日上班现在才到家 封面www.pixiv.net/member_illust.php?mode=medium&amp;illust_id=56912929',
|
||||||
|
},
|
||||||
|
'playlist': [{
|
||||||
|
'md5': '55cdadedf3254caaa0d5d27cf20a8f9c',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '4808130_part1',
|
||||||
|
'ext': 'flv',
|
||||||
|
'title': '【长篇】哆啦A梦443【钉铛】',
|
||||||
|
'description': '(2016.05.27)来组合客人的脸吧&amp;寻母六千里锭 抱歉,又轮到周日上班现在才到家 封面www.pixiv.net/member_illust.php?mode=medium&amp;illust_id=56912929',
|
||||||
|
'timestamp': 1464564180,
|
||||||
|
'upload_date': '20160529',
|
||||||
|
'uploader': '喜欢拉面',
|
||||||
|
'uploader_id': '151066',
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'md5': '926f9f67d0c482091872fbd8eca7ea3d',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '4808130_part2',
|
||||||
|
'ext': 'flv',
|
||||||
|
'title': '【长篇】哆啦A梦443【钉铛】',
|
||||||
|
'description': '(2016.05.27)来组合客人的脸吧&amp;寻母六千里锭 抱歉,又轮到周日上班现在才到家 封面www.pixiv.net/member_illust.php?mode=medium&amp;illust_id=56912929',
|
||||||
|
'timestamp': 1464564180,
|
||||||
|
'upload_date': '20160529',
|
||||||
|
'uploader': '喜欢拉面',
|
||||||
|
'uploader_id': '151066',
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'md5': '4b7b225b968402d7c32348c646f1fd83',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '4808130_part3',
|
||||||
|
'ext': 'flv',
|
||||||
|
'title': '【长篇】哆啦A梦443【钉铛】',
|
||||||
|
'description': '(2016.05.27)来组合客人的脸吧&amp;寻母六千里锭 抱歉,又轮到周日上班现在才到家 封面www.pixiv.net/member_illust.php?mode=medium&amp;illust_id=56912929',
|
||||||
|
'timestamp': 1464564180,
|
||||||
|
'upload_date': '20160529',
|
||||||
|
'uploader': '喜欢拉面',
|
||||||
|
'uploader_id': '151066',
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'md5': '7b795e214166501e9141139eea236e91',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '4808130_part4',
|
||||||
|
'ext': 'flv',
|
||||||
|
'title': '【长篇】哆啦A梦443【钉铛】',
|
||||||
|
'description': '(2016.05.27)来组合客人的脸吧&amp;寻母六千里锭 抱歉,又轮到周日上班现在才到家 封面www.pixiv.net/member_illust.php?mode=medium&amp;illust_id=56912929',
|
||||||
|
'timestamp': 1464564180,
|
||||||
|
'upload_date': '20160529',
|
||||||
|
'uploader': '喜欢拉面',
|
||||||
|
'uploader_id': '151066',
|
||||||
|
},
|
||||||
|
}],
|
||||||
|
}, {
|
||||||
|
# Missing upload time
|
||||||
|
'url': 'http://www.bilibili.com/video/av1867637/',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '2880301',
|
||||||
|
'ext': 'flv',
|
||||||
|
'title': '【HDTV】【喜剧】岳父岳母真难当 (2014)【法国票房冠军】',
|
||||||
|
'description': '一个信奉天主教的法国旧式传统资产阶级家庭中有四个女儿。三个女儿却分别找了阿拉伯、犹太、中国丈夫,老夫老妻唯独期盼剩下未嫁的小女儿能找一个信奉天主教的法国白人,结果没想到小女儿找了一位非裔黑人……【这次应该不会跳帧了】',
|
||||||
|
'uploader': '黑夜为猫',
|
||||||
|
'uploader_id': '610729',
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
# Just to test metadata extraction
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
'expected_warnings': ['upload time'],
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
# BiliBili blocks keys from time to time. The current key is extracted from
|
||||||
|
# the Android client
|
||||||
|
# TODO: find the sign algorithm used in the flash player
|
||||||
|
_APP_KEY = '86385cdc024c0f6c'
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
video_id = mobj.group('id')
|
video_id = mobj.group('id')
|
||||||
page_num = mobj.group('page_num') or '1'
|
|
||||||
|
|
||||||
view_data = self._download_json(
|
webpage = self._download_webpage(url, video_id)
|
||||||
'http://api.bilibili.com/view?type=json&appkey=8e9fc618fbd41e28&id=%s&page=%s' % (video_id, page_num),
|
|
||||||
video_id)
|
|
||||||
if 'error' in view_data:
|
|
||||||
raise ExtractorError('%s said: %s' % (self.IE_NAME, view_data['error']), expected=True)
|
|
||||||
|
|
||||||
cid = view_data['cid']
|
params = compat_parse_qs(self._search_regex(
|
||||||
title = unescapeHTML(view_data['title'])
|
[r'EmbedPlayer\([^)]+,\s*"([^"]+)"\)',
|
||||||
|
r'<iframe[^>]+src="https://secure\.bilibili\.com/secure,([^"]+)"'],
|
||||||
|
webpage, 'player parameters'))
|
||||||
|
cid = params['cid'][0]
|
||||||
|
|
||||||
doc = self._download_xml(
|
info_xml_str = self._download_webpage(
|
||||||
'http://interface.bilibili.com/v_cdn_play?appkey=8e9fc618fbd41e28&cid=%s' % cid,
|
'http://interface.bilibili.com/v_cdn_play',
|
||||||
cid,
|
cid, query={'appkey': self._APP_KEY, 'cid': cid},
|
||||||
'Downloading page %s/%s' % (page_num, view_data['pages'])
|
note='Downloading video info page')
|
||||||
)
|
|
||||||
|
|
||||||
if xpath_text(doc, './result') == 'error':
|
err_msg = None
|
||||||
raise ExtractorError('%s said: %s' % (self.IE_NAME, xpath_text(doc, './message')), expected=True)
|
durls = None
|
||||||
|
info_xml = None
|
||||||
|
try:
|
||||||
|
info_xml = compat_etree_fromstring(info_xml_str.encode('utf-8'))
|
||||||
|
except compat_xml_parse_error:
|
||||||
|
info_json = self._parse_json(info_xml_str, video_id, fatal=False)
|
||||||
|
err_msg = (info_json or {}).get('error_text')
|
||||||
|
else:
|
||||||
|
err_msg = xpath_text(info_xml, './message')
|
||||||
|
|
||||||
|
if info_xml is not None:
|
||||||
|
durls = info_xml.findall('./durl')
|
||||||
|
if not durls:
|
||||||
|
if err_msg:
|
||||||
|
raise ExtractorError('%s said: %s' % (self.IE_NAME, err_msg), expected=True)
|
||||||
|
else:
|
||||||
|
raise ExtractorError('No videos found!')
|
||||||
|
|
||||||
entries = []
|
entries = []
|
||||||
|
|
||||||
for durl in doc.findall('./durl'):
|
for durl in durls:
|
||||||
size = xpath_text(durl, ['./filesize', './size'])
|
size = xpath_text(durl, ['./filesize', './size'])
|
||||||
formats = [{
|
formats = [{
|
||||||
'url': durl.find('./url').text,
|
'url': durl.find('./url').text,
|
||||||
'filesize': int_or_none(size),
|
'filesize': int_or_none(size),
|
||||||
'ext': 'flv',
|
|
||||||
}]
|
}]
|
||||||
backup_urls = durl.find('./backup_url')
|
for backup_url in durl.findall('./backup_url/url'):
|
||||||
if backup_urls is not None:
|
formats.append({
|
||||||
for backup_url in backup_urls.findall('./url'):
|
'url': backup_url.text,
|
||||||
formats.append({'url': backup_url.text})
|
# backup URLs have lower priorities
|
||||||
formats.reverse()
|
'preference': -2 if 'hd.mp4' in backup_url.text else -3,
|
||||||
|
})
|
||||||
|
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
entries.append({
|
entries.append({
|
||||||
'id': '%s_part%s' % (cid, xpath_text(durl, './order')),
|
'id': '%s_part%s' % (cid, xpath_text(durl, './order')),
|
||||||
'title': title,
|
|
||||||
'duration': int_or_none(xpath_text(durl, './length'), 1000),
|
'duration': int_or_none(xpath_text(durl, './length'), 1000),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
title = self._html_search_regex('<h1[^>]+title="([^"]+)">', webpage, 'title')
|
||||||
|
description = self._html_search_meta('description', webpage)
|
||||||
|
datetime_str = self._html_search_regex(
|
||||||
|
r'<time[^>]+datetime="([^"]+)"', webpage, 'upload time', fatal=False)
|
||||||
|
timestamp = None
|
||||||
|
if datetime_str:
|
||||||
|
timestamp = calendar.timegm(datetime.datetime.strptime(datetime_str, '%Y-%m-%dT%H:%M').timetuple())
|
||||||
|
|
||||||
|
# TODO 'view_count' requires deobfuscating Javascript
|
||||||
info = {
|
info = {
|
||||||
'id': compat_str(cid),
|
'id': compat_str(cid),
|
||||||
'title': title,
|
'title': title,
|
||||||
'description': view_data.get('description'),
|
'description': description,
|
||||||
'thumbnail': view_data.get('pic'),
|
'timestamp': timestamp,
|
||||||
'uploader': view_data.get('author'),
|
'thumbnail': self._html_search_meta('thumbnailUrl', webpage),
|
||||||
'timestamp': int_or_none(view_data.get('created')),
|
'duration': float_or_none(xpath_text(info_xml, './timelength'), scale=1000),
|
||||||
'view_count': int_or_none(view_data.get('play')),
|
|
||||||
'duration': int_or_none(xpath_text(doc, './timelength')),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uploader_mobj = re.search(
|
||||||
|
r'<a[^>]+href="https?://space\.bilibili\.com/(?P<id>\d+)"[^>]+title="(?P<name>[^"]+)"',
|
||||||
|
webpage)
|
||||||
|
if uploader_mobj:
|
||||||
|
info.update({
|
||||||
|
'uploader': uploader_mobj.group('name'),
|
||||||
|
'uploader_id': uploader_mobj.group('id'),
|
||||||
|
})
|
||||||
|
|
||||||
|
for entry in entries:
|
||||||
|
entry.update(info)
|
||||||
|
|
||||||
if len(entries) == 1:
|
if len(entries) == 1:
|
||||||
entries[0].update(info)
|
|
||||||
return entries[0]
|
return entries[0]
|
||||||
else:
|
else:
|
||||||
info.update({
|
for idx, entry in enumerate(entries):
|
||||||
|
entry['id'] = '%s_part%d' % (video_id, (idx + 1))
|
||||||
|
|
||||||
|
return {
|
||||||
'_type': 'multi_video',
|
'_type': 'multi_video',
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
'title': title,
|
||||||
|
'description': description,
|
||||||
'entries': entries,
|
'entries': entries,
|
||||||
})
|
}
|
||||||
return info
|
|
||||||
|
|||||||
39
youtube_dl/extractor/biqle.py
Normal file
39
youtube_dl/extractor/biqle.py
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
|
class BIQLEIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?biqle\.(?:com|org|ru)/watch/(?P<id>-?\d+_\d+)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://www.biqle.ru/watch/847655_160197695',
|
||||||
|
'md5': 'ad5f746a874ccded7b8f211aeea96637',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '160197695',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Foo Fighters - The Pretender (Live at Wembley Stadium)',
|
||||||
|
'uploader': 'Andrey Rogozin',
|
||||||
|
'upload_date': '20110605',
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'url': 'https://biqle.org/watch/-44781847_168547604',
|
||||||
|
'md5': '7f24e72af1db0edf7c1aaba513174f97',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '168547604',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Ребенок в шоке от автоматической мойки',
|
||||||
|
'uploader': 'Dmitry Kotov',
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
embed_url = self._proto_relative_url(self._search_regex(
|
||||||
|
r'<iframe.+?src="((?:http:)?//daxab\.com/[^"]+)".*?></iframe>', webpage, 'embed url'))
|
||||||
|
|
||||||
|
return {
|
||||||
|
'_type': 'url_transparent',
|
||||||
|
'url': embed_url,
|
||||||
|
}
|
||||||
@@ -17,6 +17,9 @@ class BloombergIE(InfoExtractor):
|
|||||||
'title': 'Shah\'s Presentation on Foreign-Exchange Strategies',
|
'title': 'Shah\'s Presentation on Foreign-Exchange Strategies',
|
||||||
'description': 'md5:a8ba0302912d03d246979735c17d2761',
|
'description': 'md5:a8ba0302912d03d246979735c17d2761',
|
||||||
},
|
},
|
||||||
|
'params': {
|
||||||
|
'format': 'best[format_id^=hds]',
|
||||||
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.bloomberg.com/news/articles/2015-11-12/five-strange-things-that-have-been-happening-in-financial-markets',
|
'url': 'http://www.bloomberg.com/news/articles/2015-11-12/five-strange-things-that-have-been-happening-in-financial-markets',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ class BRIE(InfoExtractor):
|
|||||||
'duration': 180,
|
'duration': 180,
|
||||||
'uploader': 'Reinhard Weber',
|
'uploader': 'Reinhard Weber',
|
||||||
'upload_date': '20150422',
|
'upload_date': '20150422',
|
||||||
}
|
},
|
||||||
|
'skip': '404 not found',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'url': 'http://www.br.de/nachrichten/oberbayern/inhalt/muenchner-polizeipraesident-schreiber-gestorben-100.html',
|
'url': 'http://www.br.de/nachrichten/oberbayern/inhalt/muenchner-polizeipraesident-schreiber-gestorben-100.html',
|
||||||
@@ -40,7 +41,8 @@ class BRIE(InfoExtractor):
|
|||||||
'title': 'Manfred Schreiber ist tot',
|
'title': 'Manfred Schreiber ist tot',
|
||||||
'description': 'md5:b454d867f2a9fc524ebe88c3f5092d97',
|
'description': 'md5:b454d867f2a9fc524ebe88c3f5092d97',
|
||||||
'duration': 26,
|
'duration': 26,
|
||||||
}
|
},
|
||||||
|
'skip': '404 not found',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'url': 'https://www.br-klassik.de/audio/peeping-tom-premierenkritik-dance-festival-muenchen-100.html',
|
'url': 'https://www.br-klassik.de/audio/peeping-tom-premierenkritik-dance-festival-muenchen-100.html',
|
||||||
@@ -51,7 +53,8 @@ class BRIE(InfoExtractor):
|
|||||||
'title': 'Kurzweilig und sehr bewegend',
|
'title': 'Kurzweilig und sehr bewegend',
|
||||||
'description': 'md5:0351996e3283d64adeb38ede91fac54e',
|
'description': 'md5:0351996e3283d64adeb38ede91fac54e',
|
||||||
'duration': 296,
|
'duration': 296,
|
||||||
}
|
},
|
||||||
|
'skip': '404 not found',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'url': 'http://www.br.de/radio/bayern1/service/team/videos/team-video-erdelt100.html',
|
'url': 'http://www.br.de/radio/bayern1/service/team/videos/team-video-erdelt100.html',
|
||||||
|
|||||||
@@ -307,9 +307,10 @@ class BrightcoveLegacyIE(InfoExtractor):
|
|||||||
playlist_title=playlist_info['mediaCollectionDTO']['displayName'])
|
playlist_title=playlist_info['mediaCollectionDTO']['displayName'])
|
||||||
|
|
||||||
def _extract_video_info(self, video_info):
|
def _extract_video_info(self, video_info):
|
||||||
|
video_id = compat_str(video_info['id'])
|
||||||
publisher_id = video_info.get('publisherId')
|
publisher_id = video_info.get('publisherId')
|
||||||
info = {
|
info = {
|
||||||
'id': compat_str(video_info['id']),
|
'id': video_id,
|
||||||
'title': video_info['displayName'].strip(),
|
'title': video_info['displayName'].strip(),
|
||||||
'description': video_info.get('shortDescription'),
|
'description': video_info.get('shortDescription'),
|
||||||
'thumbnail': video_info.get('videoStillURL') or video_info.get('thumbnailURL'),
|
'thumbnail': video_info.get('videoStillURL') or video_info.get('thumbnailURL'),
|
||||||
@@ -331,7 +332,8 @@ class BrightcoveLegacyIE(InfoExtractor):
|
|||||||
url_comp = compat_urllib_parse_urlparse(url)
|
url_comp = compat_urllib_parse_urlparse(url)
|
||||||
if url_comp.path.endswith('.m3u8'):
|
if url_comp.path.endswith('.m3u8'):
|
||||||
formats.extend(
|
formats.extend(
|
||||||
self._extract_m3u8_formats(url, info['id'], 'mp4'))
|
self._extract_m3u8_formats(
|
||||||
|
url, video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False))
|
||||||
continue
|
continue
|
||||||
elif 'akamaihd.net' in url_comp.netloc:
|
elif 'akamaihd.net' in url_comp.netloc:
|
||||||
# This type of renditions are served through
|
# This type of renditions are served through
|
||||||
@@ -340,7 +342,7 @@ class BrightcoveLegacyIE(InfoExtractor):
|
|||||||
ext = 'flv'
|
ext = 'flv'
|
||||||
if ext is None:
|
if ext is None:
|
||||||
ext = determine_ext(url)
|
ext = determine_ext(url)
|
||||||
tbr = int_or_none(rend.get('encodingRate'), 1000),
|
tbr = int_or_none(rend.get('encodingRate'), 1000)
|
||||||
a_format = {
|
a_format = {
|
||||||
'format_id': 'http%s' % ('-%s' % tbr if tbr else ''),
|
'format_id': 'http%s' % ('-%s' % tbr if tbr else ''),
|
||||||
'url': url,
|
'url': url,
|
||||||
@@ -365,7 +367,7 @@ class BrightcoveLegacyIE(InfoExtractor):
|
|||||||
a_format.update({
|
a_format.update({
|
||||||
'format_id': 'hls%s' % ('-%s' % tbr if tbr else ''),
|
'format_id': 'hls%s' % ('-%s' % tbr if tbr else ''),
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'protocol': 'm3u8',
|
'protocol': 'm3u8_native',
|
||||||
})
|
})
|
||||||
|
|
||||||
formats.append(a_format)
|
formats.append(a_format)
|
||||||
@@ -395,7 +397,7 @@ class BrightcoveLegacyIE(InfoExtractor):
|
|||||||
return ad_info
|
return ad_info
|
||||||
|
|
||||||
if 'url' not in info and not info.get('formats'):
|
if 'url' not in info and not info.get('formats'):
|
||||||
raise ExtractorError('Unable to extract video url for %s' % info['id'])
|
raise ExtractorError('Unable to extract video url for %s' % video_id)
|
||||||
return info
|
return info
|
||||||
|
|
||||||
|
|
||||||
@@ -442,6 +444,10 @@ class BrightcoveNewIE(InfoExtractor):
|
|||||||
# non numeric ref: prefixed video id
|
# non numeric ref: prefixed video id
|
||||||
'url': 'http://players.brightcove.net/710858724001/default_default/index.html?videoId=ref:event-stream-356',
|
'url': 'http://players.brightcove.net/710858724001/default_default/index.html?videoId=ref:event-stream-356',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
# unavailable video without message but with error_code
|
||||||
|
'url': 'http://players.brightcove.net/1305187701/c832abfb-641b-44eb-9da0-2fe76786505f_default/index.html?videoId=4377407326001',
|
||||||
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -512,8 +518,9 @@ class BrightcoveNewIE(InfoExtractor):
|
|||||||
})
|
})
|
||||||
except ExtractorError as e:
|
except ExtractorError as e:
|
||||||
if isinstance(e.cause, compat_HTTPError) and e.cause.code == 403:
|
if isinstance(e.cause, compat_HTTPError) and e.cause.code == 403:
|
||||||
json_data = self._parse_json(e.cause.read().decode(), video_id)
|
json_data = self._parse_json(e.cause.read().decode(), video_id)[0]
|
||||||
raise ExtractorError(json_data[0]['message'], expected=True)
|
raise ExtractorError(
|
||||||
|
json_data.get('message') or json_data['error_code'], expected=True)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
title = json_data['name'].strip()
|
title = json_data['name'].strip()
|
||||||
@@ -527,7 +534,7 @@ class BrightcoveNewIE(InfoExtractor):
|
|||||||
if not src:
|
if not src:
|
||||||
continue
|
continue
|
||||||
formats.extend(self._extract_m3u8_formats(
|
formats.extend(self._extract_m3u8_formats(
|
||||||
src, video_id, 'mp4', m3u8_id='hls', fatal=False))
|
src, video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False))
|
||||||
elif source_type == 'application/dash+xml':
|
elif source_type == 'application/dash+xml':
|
||||||
if not src:
|
if not src:
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class BYUtvIE(InfoExtractor):
|
|||||||
_VALID_URL = r'^https?://(?:www\.)?byutv.org/watch/[0-9a-f-]+/(?P<video_id>[^/?#]+)'
|
_VALID_URL = r'^https?://(?:www\.)?byutv.org/watch/[0-9a-f-]+/(?P<video_id>[^/?#]+)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://www.byutv.org/watch/6587b9a3-89d2-42a6-a7f7-fd2f81840a7d/studio-c-season-5-episode-5',
|
'url': 'http://www.byutv.org/watch/6587b9a3-89d2-42a6-a7f7-fd2f81840a7d/studio-c-season-5-episode-5',
|
||||||
|
'md5': '05850eb8c749e2ee05ad5a1c34668493',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'studio-c-season-5-episode-5',
|
'id': 'studio-c-season-5-episode-5',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@@ -21,7 +22,8 @@ class BYUtvIE(InfoExtractor):
|
|||||||
},
|
},
|
||||||
'params': {
|
'params': {
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
}
|
},
|
||||||
|
'add_ie': ['Ooyala'],
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ from __future__ import unicode_literals
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from ..compat import compat_urllib_parse_urlparse
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
HEADRequest,
|
HEADRequest,
|
||||||
unified_strdate,
|
unified_strdate,
|
||||||
url_basename,
|
|
||||||
qualities,
|
qualities,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
)
|
)
|
||||||
@@ -16,24 +16,38 @@ from ..utils import (
|
|||||||
|
|
||||||
class CanalplusIE(InfoExtractor):
|
class CanalplusIE(InfoExtractor):
|
||||||
IE_DESC = 'canalplus.fr, piwiplus.fr and d8.tv'
|
IE_DESC = 'canalplus.fr, piwiplus.fr and d8.tv'
|
||||||
_VALID_URL = r'https?://(?:www\.(?P<site>canalplus\.fr|piwiplus\.fr|d8\.tv|itele\.fr)/.*?/(?P<path>.*)|player\.canalplus\.fr/#/(?P<id>[0-9]+))'
|
_VALID_URL = r'''(?x)
|
||||||
|
https?://
|
||||||
|
(?:
|
||||||
|
(?:
|
||||||
|
(?:(?:www|m)\.)?canalplus\.fr|
|
||||||
|
(?:www\.)?piwiplus\.fr|
|
||||||
|
(?:www\.)?d8\.tv|
|
||||||
|
(?:www\.)?d17\.tv|
|
||||||
|
(?:www\.)?itele\.fr
|
||||||
|
)/(?:(?:[^/]+/)*(?P<display_id>[^/?#&]+))?(?:\?.*\bvid=(?P<vid>\d+))?|
|
||||||
|
player\.canalplus\.fr/#/(?P<id>\d+)
|
||||||
|
)
|
||||||
|
|
||||||
|
'''
|
||||||
_VIDEO_INFO_TEMPLATE = 'http://service.canal-plus.com/video/rest/getVideosLiees/%s/%s?format=json'
|
_VIDEO_INFO_TEMPLATE = 'http://service.canal-plus.com/video/rest/getVideosLiees/%s/%s?format=json'
|
||||||
_SITE_ID_MAP = {
|
_SITE_ID_MAP = {
|
||||||
'canalplus.fr': 'cplus',
|
'canalplus': 'cplus',
|
||||||
'piwiplus.fr': 'teletoon',
|
'piwiplus': 'teletoon',
|
||||||
'd8.tv': 'd8',
|
'd8': 'd8',
|
||||||
'itele.fr': 'itele',
|
'd17': 'd17',
|
||||||
|
'itele': 'itele',
|
||||||
}
|
}
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://www.canalplus.fr/c-emissions/pid1830-c-zapping.html?vid=1263092',
|
'url': 'http://www.canalplus.fr/c-emissions/pid1830-c-zapping.html?vid=1192814',
|
||||||
'md5': '12164a6f14ff6df8bd628e8ba9b10b78',
|
'md5': '41f438a4904f7664b91b4ed0dec969dc',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '1263092',
|
'id': '1192814',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Le Zapping - 13/05/15',
|
'title': "L'Année du Zapping 2014 - L'Année du Zapping 2014",
|
||||||
'description': 'md5:09738c0d06be4b5d06a0940edb0da73f',
|
'description': "Toute l'année 2014 dans un Zapping exceptionnel !",
|
||||||
'upload_date': '20150513',
|
'upload_date': '20150105',
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.piwiplus.fr/videos-piwi/pid1405-le-labyrinthe-boing-super-ranger.html?vid=1108190',
|
'url': 'http://www.piwiplus.fr/videos-piwi/pid1405-le-labyrinthe-boing-super-ranger.html?vid=1108190',
|
||||||
@@ -46,35 +60,45 @@ class CanalplusIE(InfoExtractor):
|
|||||||
},
|
},
|
||||||
'skip': 'Only works from France',
|
'skip': 'Only works from France',
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.d8.tv/d8-docs-mags/pid6589-d8-campagne-intime.html',
|
'url': 'http://www.d8.tv/d8-docs-mags/pid5198-d8-en-quete-d-actualite.html?vid=1390231',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '966289',
|
'id': '1390231',
|
||||||
'ext': 'flv',
|
|
||||||
'title': 'Campagne intime - Documentaire exceptionnel',
|
|
||||||
'description': 'md5:d2643b799fb190846ae09c61e59a859f',
|
|
||||||
'upload_date': '20131108',
|
|
||||||
},
|
|
||||||
'skip': 'videos get deleted after a while',
|
|
||||||
}, {
|
|
||||||
'url': 'http://www.itele.fr/france/video/aubervilliers-un-lycee-en-colere-111559',
|
|
||||||
'md5': '38b8f7934def74f0d6f3ba6c036a5f82',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '1213714',
|
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Aubervilliers : un lycée en colère - Le 11/02/2015 à 06h45',
|
'title': "Vacances pas chères : prix discount ou grosses dépenses ? - En quête d'actualité",
|
||||||
'description': 'md5:8216206ec53426ea6321321f3b3c16db',
|
'description': 'md5:edb6cf1cb4a1e807b5dd089e1ac8bfc6',
|
||||||
'upload_date': '20150211',
|
'upload_date': '20160512',
|
||||||
},
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.itele.fr/chroniques/invite-bruce-toussaint/thierry-solere-nicolas-sarkozy-officialisera-sa-candidature-a-la-primaire-quand-il-le-voudra-167224',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '1398334',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': "L'invité de Bruce Toussaint du 07/06/2016 - ",
|
||||||
|
'description': 'md5:40ac7c9ad0feaeb6f605bad986f61324',
|
||||||
|
'upload_date': '20160607',
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'url': 'http://m.canalplus.fr/?vid=1398231',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.d17.tv/emissions/pid8303-lolywood.html?vid=1397061',
|
||||||
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
video_id = mobj.groupdict().get('id')
|
video_id = mobj.groupdict().get('id') or mobj.groupdict().get('vid')
|
||||||
|
|
||||||
site_id = self._SITE_ID_MAP[mobj.group('site') or 'canal']
|
site_id = self._SITE_ID_MAP[compat_urllib_parse_urlparse(url).netloc.rsplit('.', 2)[-2]]
|
||||||
|
|
||||||
# Beware, some subclasses do not define an id group
|
# Beware, some subclasses do not define an id group
|
||||||
display_id = url_basename(mobj.group('path'))
|
display_id = mobj.group('display_id') or video_id
|
||||||
|
|
||||||
if video_id is None:
|
if video_id is None:
|
||||||
webpage = self._download_webpage(url, display_id)
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
|||||||
88
youtube_dl/extractor/carambatv.py
Normal file
88
youtube_dl/extractor/carambatv.py
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..compat import compat_str
|
||||||
|
from ..utils import (
|
||||||
|
float_or_none,
|
||||||
|
int_or_none,
|
||||||
|
try_get,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class CarambaTVIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'(?:carambatv:|https?://video1\.carambatv\.ru/v/)(?P<id>\d+)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://video1.carambatv.ru/v/191910501',
|
||||||
|
'md5': '2f4a81b7cfd5ab866ee2d7270cb34a2a',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '191910501',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': '[BadComedian] - Разборка в Маниле (Абсолютный обзор)',
|
||||||
|
'thumbnail': 're:^https?://.*\.jpg',
|
||||||
|
'duration': 2678.31,
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'url': 'carambatv:191910501',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
video = self._download_json(
|
||||||
|
'http://video1.carambatv.ru/v/%s/videoinfo.js' % video_id,
|
||||||
|
video_id)
|
||||||
|
|
||||||
|
title = video['title']
|
||||||
|
|
||||||
|
base_url = video.get('video') or 'http://video1.carambatv.ru/v/%s/' % video_id
|
||||||
|
|
||||||
|
formats = [{
|
||||||
|
'url': base_url + f['fn'],
|
||||||
|
'height': int_or_none(f.get('height')),
|
||||||
|
'format_id': '%sp' % f['height'] if f.get('height') else None,
|
||||||
|
} for f in video['qualities'] if f.get('fn')]
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
thumbnail = video.get('splash')
|
||||||
|
duration = float_or_none(try_get(
|
||||||
|
video, lambda x: x['annotations'][0]['end_time'], compat_str))
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': title,
|
||||||
|
'thumbnail': thumbnail,
|
||||||
|
'duration': duration,
|
||||||
|
'formats': formats,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class CarambaTVPageIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://carambatv\.ru/(?:[^/]+/)+(?P<id>[^/?#&]+)'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'http://carambatv.ru/movie/bad-comedian/razborka-v-manile/',
|
||||||
|
'md5': '',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '191910501',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': '[BadComedian] - Разборка в Маниле (Абсолютный обзор)',
|
||||||
|
'thumbnail': 're:^https?://.*\.jpg$',
|
||||||
|
'duration': 2678.31,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
|
video_url = self._og_search_property('video:iframe', webpage, default=None)
|
||||||
|
|
||||||
|
if not video_url:
|
||||||
|
video_id = self._search_regex(
|
||||||
|
r'(?:video_id|crmb_vuid)\s*[:=]\s*["\']?(\d+)',
|
||||||
|
webpage, 'video id')
|
||||||
|
video_url = 'carambatv:%s' % video_id
|
||||||
|
|
||||||
|
return self.url_result(video_url, CarambaTVIE.ie_key())
|
||||||
@@ -4,64 +4,66 @@ from __future__ import unicode_literals
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import js_to_json
|
from ..utils import (
|
||||||
|
js_to_json,
|
||||||
|
smuggle_url,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class CBCIE(InfoExtractor):
|
class CBCIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?cbc\.ca/(?:[^/]+/)+(?P<id>[^/?#]+)'
|
_VALID_URL = r'https?://(?:www\.)?cbc\.ca/(?!player/)(?:[^/]+/)+(?P<id>[^/?#]+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
# with mediaId
|
# with mediaId
|
||||||
'url': 'http://www.cbc.ca/22minutes/videos/clips-season-23/don-cherry-play-offs',
|
'url': 'http://www.cbc.ca/22minutes/videos/clips-season-23/don-cherry-play-offs',
|
||||||
|
'md5': '97e24d09672fc4cf56256d6faa6c25bc',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '2682904050',
|
'id': '2682904050',
|
||||||
'ext': 'flv',
|
'ext': 'mp4',
|
||||||
'title': 'Don Cherry – All-Stars',
|
'title': 'Don Cherry – All-Stars',
|
||||||
'description': 'Don Cherry has a bee in his bonnet about AHL player John Scott because that guy’s got heart.',
|
'description': 'Don Cherry has a bee in his bonnet about AHL player John Scott because that guy’s got heart.',
|
||||||
'timestamp': 1454475540,
|
'timestamp': 1454463000,
|
||||||
'upload_date': '20160203',
|
'upload_date': '20160203',
|
||||||
},
|
'uploader': 'CBCC-NEW',
|
||||||
'params': {
|
|
||||||
# rtmp download
|
|
||||||
'skip_download': True,
|
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
# with clipId
|
# with clipId
|
||||||
'url': 'http://www.cbc.ca/archives/entry/1978-robin-williams-freestyles-on-90-minutes-live',
|
'url': 'http://www.cbc.ca/archives/entry/1978-robin-williams-freestyles-on-90-minutes-live',
|
||||||
|
'md5': '0274a90b51a9b4971fe005c63f592f12',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '2487345465',
|
'id': '2487345465',
|
||||||
'ext': 'flv',
|
'ext': 'mp4',
|
||||||
'title': 'Robin Williams freestyles on 90 Minutes Live',
|
'title': 'Robin Williams freestyles on 90 Minutes Live',
|
||||||
'description': 'Wacky American comedian Robin Williams shows off his infamous "freestyle" comedic talents while being interviewed on CBC\'s 90 Minutes Live.',
|
'description': 'Wacky American comedian Robin Williams shows off his infamous "freestyle" comedic talents while being interviewed on CBC\'s 90 Minutes Live.',
|
||||||
'upload_date': '19700101',
|
'upload_date': '19780210',
|
||||||
},
|
'uploader': 'CBCC-NEW',
|
||||||
'params': {
|
'timestamp': 255977160,
|
||||||
# rtmp download
|
|
||||||
'skip_download': True,
|
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
# multiple iframes
|
# multiple iframes
|
||||||
'url': 'http://www.cbc.ca/natureofthings/blog/birds-eye-view-from-vancouvers-burrard-street-bridge-how-we-got-the-shot',
|
'url': 'http://www.cbc.ca/natureofthings/blog/birds-eye-view-from-vancouvers-burrard-street-bridge-how-we-got-the-shot',
|
||||||
'playlist': [{
|
'playlist': [{
|
||||||
|
'md5': '377572d0b49c4ce0c9ad77470e0b96b4',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '2680832926',
|
'id': '2680832926',
|
||||||
'ext': 'flv',
|
'ext': 'mp4',
|
||||||
'title': 'An Eagle\'s-Eye View Off Burrard Bridge',
|
'title': 'An Eagle\'s-Eye View Off Burrard Bridge',
|
||||||
'description': 'Hercules the eagle flies from Vancouver\'s Burrard Bridge down to a nearby park with a mini-camera strapped to his back.',
|
'description': 'Hercules the eagle flies from Vancouver\'s Burrard Bridge down to a nearby park with a mini-camera strapped to his back.',
|
||||||
'upload_date': '19700101',
|
'upload_date': '20160201',
|
||||||
|
'timestamp': 1454342820,
|
||||||
|
'uploader': 'CBCC-NEW',
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
|
'md5': '415a0e3f586113894174dfb31aa5bb1a',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '2658915080',
|
'id': '2658915080',
|
||||||
'ext': 'flv',
|
'ext': 'mp4',
|
||||||
'title': 'Fly like an eagle!',
|
'title': 'Fly like an eagle!',
|
||||||
'description': 'Eagle equipped with a mini camera flies from the world\'s tallest tower',
|
'description': 'Eagle equipped with a mini camera flies from the world\'s tallest tower',
|
||||||
'upload_date': '19700101',
|
'upload_date': '20150315',
|
||||||
|
'timestamp': 1426443984,
|
||||||
|
'uploader': 'CBCC-NEW',
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
'params': {
|
|
||||||
# rtmp download
|
|
||||||
'skip_download': True,
|
|
||||||
},
|
|
||||||
}]
|
}]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -90,24 +92,54 @@ class CBCIE(InfoExtractor):
|
|||||||
|
|
||||||
class CBCPlayerIE(InfoExtractor):
|
class CBCPlayerIE(InfoExtractor):
|
||||||
_VALID_URL = r'(?:cbcplayer:|https?://(?:www\.)?cbc\.ca/(?:player/play/|i/caffeine/syndicate/\?mediaId=))(?P<id>\d+)'
|
_VALID_URL = r'(?:cbcplayer:|https?://(?:www\.)?cbc\.ca/(?:player/play/|i/caffeine/syndicate/\?mediaId=))(?P<id>\d+)'
|
||||||
_TEST = {
|
_TESTS = [{
|
||||||
'url': 'http://www.cbc.ca/player/play/2683190193',
|
'url': 'http://www.cbc.ca/player/play/2683190193',
|
||||||
|
'md5': '64d25f841ddf4ddb28a235338af32e2c',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '2683190193',
|
'id': '2683190193',
|
||||||
'ext': 'flv',
|
'ext': 'mp4',
|
||||||
'title': 'Gerry Runs a Sweat Shop',
|
'title': 'Gerry Runs a Sweat Shop',
|
||||||
'description': 'md5:b457e1c01e8ff408d9d801c1c2cd29b0',
|
'description': 'md5:b457e1c01e8ff408d9d801c1c2cd29b0',
|
||||||
'timestamp': 1455067800,
|
'timestamp': 1455071400,
|
||||||
'upload_date': '20160210',
|
'upload_date': '20160210',
|
||||||
|
'uploader': 'CBCC-NEW',
|
||||||
},
|
},
|
||||||
'params': {
|
}, {
|
||||||
# rtmp download
|
# Redirected from http://www.cbc.ca/player/AudioMobile/All%20in%20a%20Weekend%20Montreal/ID/2657632011/
|
||||||
'skip_download': True,
|
'url': 'http://www.cbc.ca/player/play/2657631896',
|
||||||
|
'md5': 'e5e708c34ae6fca156aafe17c43e8b75',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '2657631896',
|
||||||
|
'ext': 'mp3',
|
||||||
|
'title': 'CBC Montreal is organizing its first ever community hackathon!',
|
||||||
|
'description': 'The modern technology we tend to depend on so heavily, is never without it\'s share of hiccups and headaches. Next weekend - CBC Montreal will be getting members of the public for its first Hackathon.',
|
||||||
|
'timestamp': 1425704400,
|
||||||
|
'upload_date': '20150307',
|
||||||
|
'uploader': 'CBCC-NEW',
|
||||||
},
|
},
|
||||||
}
|
}, {
|
||||||
|
# available only when we add `formats=MPEG4,FLV,MP3` to theplatform url
|
||||||
|
'url': 'http://www.cbc.ca/player/play/2164402062',
|
||||||
|
'md5': '17a61eb813539abea40618d6323a7f82',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '2164402062',
|
||||||
|
'ext': 'flv',
|
||||||
|
'title': 'Cancer survivor four times over',
|
||||||
|
'description': 'Tim Mayer has beaten three different forms of cancer four times in five years.',
|
||||||
|
'timestamp': 1320410746,
|
||||||
|
'upload_date': '20111104',
|
||||||
|
'uploader': 'CBCC-NEW',
|
||||||
|
},
|
||||||
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
return self.url_result(
|
return {
|
||||||
'http://feed.theplatform.com/f/ExhSPC/vms_5akSXx4Ng_Zn?byGuid=%s' % video_id,
|
'_type': 'url_transparent',
|
||||||
'ThePlatformFeed', video_id)
|
'ie_key': 'ThePlatform',
|
||||||
|
'url': smuggle_url(
|
||||||
|
'http://link.theplatform.com/s/ExhSPC/media/guid/2655402169/%s?mbr=true&formats=MPEG4,FLV,MP3' % video_id, {
|
||||||
|
'force_smil_url': True
|
||||||
|
}),
|
||||||
|
'id': video_id,
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .theplatform import ThePlatformIE
|
from .theplatform import ThePlatformFeedIE
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
xpath_text,
|
|
||||||
xpath_element,
|
|
||||||
int_or_none,
|
int_or_none,
|
||||||
ExtractorError,
|
|
||||||
find_xpath_attr,
|
find_xpath_attr,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class CBSBaseIE(ThePlatformIE):
|
class CBSBaseIE(ThePlatformFeedIE):
|
||||||
def _parse_smil_subtitles(self, smil, namespace=None, subtitles_lang='en'):
|
def _parse_smil_subtitles(self, smil, namespace=None, subtitles_lang='en'):
|
||||||
closed_caption_e = find_xpath_attr(smil, self._xpath_ns('.//param', namespace), 'name', 'ClosedCaptionURL')
|
closed_caption_e = find_xpath_attr(smil, self._xpath_ns('.//param', namespace), 'name', 'ClosedCaptionURL')
|
||||||
return {
|
return {
|
||||||
@@ -20,9 +17,22 @@ class CBSBaseIE(ThePlatformIE):
|
|||||||
}]
|
}]
|
||||||
} if closed_caption_e is not None and closed_caption_e.attrib.get('value') else []
|
} if closed_caption_e is not None and closed_caption_e.attrib.get('value') else []
|
||||||
|
|
||||||
|
def _extract_video_info(self, filter_query, video_id):
|
||||||
|
return self._extract_feed_info(
|
||||||
|
'dJ5BDC', 'VxxJg8Ymh8sE', filter_query, video_id, lambda entry: {
|
||||||
|
'series': entry.get('cbs$SeriesTitle'),
|
||||||
|
'season_number': int_or_none(entry.get('cbs$SeasonNumber')),
|
||||||
|
'episode': entry.get('cbs$EpisodeTitle'),
|
||||||
|
'episode_number': int_or_none(entry.get('cbs$EpisodeNumber')),
|
||||||
|
}, {
|
||||||
|
'StreamPack': {
|
||||||
|
'manifest': 'm3u',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
class CBSIE(CBSBaseIE):
|
class CBSIE(CBSBaseIE):
|
||||||
_VALID_URL = r'https?://(?:www\.)?(?:cbs\.com/shows/[^/]+/(?:video|artist)|colbertlateshow\.com/(?:video|podcasts))/[^/]+/(?P<id>[^/]+)'
|
_VALID_URL = r'(?:cbs:|https?://(?:www\.)?(?:cbs\.com/shows/[^/]+/video|colbertlateshow\.com/(?:video|podcasts))/)(?P<id>[\w-]+)'
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://www.cbs.com/shows/garth-brooks/video/_u7W953k6la293J7EPTd9oHkSPs6Xn6_/connect-chat-feat-garth-brooks/',
|
'url': 'http://www.cbs.com/shows/garth-brooks/video/_u7W953k6la293J7EPTd9oHkSPs6Xn6_/connect-chat-feat-garth-brooks/',
|
||||||
@@ -37,25 +47,7 @@ class CBSIE(CBSBaseIE):
|
|||||||
'upload_date': '20131127',
|
'upload_date': '20131127',
|
||||||
'uploader': 'CBSI-NEW',
|
'uploader': 'CBSI-NEW',
|
||||||
},
|
},
|
||||||
'params': {
|
'expected_warnings': ['Failed to download m3u8 information'],
|
||||||
# rtmp download
|
|
||||||
'skip_download': True,
|
|
||||||
},
|
|
||||||
'_skip': 'Blocked outside the US',
|
|
||||||
}, {
|
|
||||||
'url': 'http://www.cbs.com/shows/liveonletterman/artist/221752/st-vincent/',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'WWF_5KqY3PK1',
|
|
||||||
'display_id': 'st-vincent',
|
|
||||||
'ext': 'flv',
|
|
||||||
'title': 'Live on Letterman - St. Vincent',
|
|
||||||
'description': 'Live On Letterman: St. Vincent in concert from New York\'s Ed Sullivan Theater on Tuesday, July 16, 2014.',
|
|
||||||
'duration': 3221,
|
|
||||||
},
|
|
||||||
'params': {
|
|
||||||
# rtmp download
|
|
||||||
'skip_download': True,
|
|
||||||
},
|
|
||||||
'_skip': 'Blocked outside the US',
|
'_skip': 'Blocked outside the US',
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://colbertlateshow.com/video/8GmB0oY0McANFvp2aEffk9jZZZ2YyXxy/the-colbeard/',
|
'url': 'http://colbertlateshow.com/video/8GmB0oY0McANFvp2aEffk9jZZZ2YyXxy/the-colbeard/',
|
||||||
@@ -64,46 +56,8 @@ class CBSIE(CBSBaseIE):
|
|||||||
'url': 'http://www.colbertlateshow.com/podcasts/dYSwjqPs_X1tvbV_P2FcPWRa_qT6akTC/in-the-bad-room-with-stephen/',
|
'url': 'http://www.colbertlateshow.com/podcasts/dYSwjqPs_X1tvbV_P2FcPWRa_qT6akTC/in-the-bad-room-with-stephen/',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
TP_RELEASE_URL_TEMPLATE = 'http://link.theplatform.com/s/dJ5BDC/%s?manifest=m3u&mbr=true'
|
TP_RELEASE_URL_TEMPLATE = 'http://link.theplatform.com/s/dJ5BDC/%s?mbr=true'
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
display_id = self._match_id(url)
|
content_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, display_id)
|
return self._extract_video_info('byGuid=%s' % content_id, content_id)
|
||||||
content_id = self._search_regex(
|
|
||||||
[r"video\.settings\.content_id\s*=\s*'([^']+)';", r"cbsplayer\.contentId\s*=\s*'([^']+)';"],
|
|
||||||
webpage, 'content id')
|
|
||||||
items_data = self._download_xml(
|
|
||||||
'http://can.cbs.com/thunder/player/videoPlayerService.php',
|
|
||||||
content_id, query={'partner': 'cbs', 'contentId': content_id})
|
|
||||||
video_data = xpath_element(items_data, './/item')
|
|
||||||
title = xpath_text(video_data, 'videoTitle', 'title', True)
|
|
||||||
|
|
||||||
subtitles = {}
|
|
||||||
formats = []
|
|
||||||
for item in items_data.findall('.//item'):
|
|
||||||
pid = xpath_text(item, 'pid')
|
|
||||||
if not pid:
|
|
||||||
continue
|
|
||||||
try:
|
|
||||||
tp_formats, tp_subtitles = self._extract_theplatform_smil(
|
|
||||||
self.TP_RELEASE_URL_TEMPLATE % pid, content_id, 'Downloading %s SMIL data' % pid)
|
|
||||||
except ExtractorError:
|
|
||||||
continue
|
|
||||||
formats.extend(tp_formats)
|
|
||||||
subtitles = self._merge_subtitles(subtitles, tp_subtitles)
|
|
||||||
self._sort_formats(formats)
|
|
||||||
|
|
||||||
info = self.get_metadata('dJ5BDC/media/guid/2198311517/%s' % content_id, content_id)
|
|
||||||
info.update({
|
|
||||||
'id': content_id,
|
|
||||||
'display_id': display_id,
|
|
||||||
'title': title,
|
|
||||||
'series': xpath_text(video_data, 'seriesTitle'),
|
|
||||||
'season_number': int_or_none(xpath_text(video_data, 'seasonNumber')),
|
|
||||||
'episode_number': int_or_none(xpath_text(video_data, 'episodeNumber')),
|
|
||||||
'duration': int_or_none(xpath_text(video_data, 'videoLength'), 1000),
|
|
||||||
'thumbnail': xpath_text(video_data, 'previewImageURL'),
|
|
||||||
'formats': formats,
|
|
||||||
'subtitles': subtitles,
|
|
||||||
})
|
|
||||||
return info
|
|
||||||
|
|||||||
84
youtube_dl/extractor/cbslocal.py
Normal file
84
youtube_dl/extractor/cbslocal.py
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import calendar
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
from .anvato import AnvatoIE
|
||||||
|
from .sendtonews import SendtoNewsIE
|
||||||
|
from ..compat import compat_urlparse
|
||||||
|
|
||||||
|
|
||||||
|
class CBSLocalIE(AnvatoIE):
|
||||||
|
_VALID_URL = r'https?://[a-z]+\.cbslocal\.com/\d+/\d+/\d+/(?P<id>[0-9a-z-]+)'
|
||||||
|
|
||||||
|
_TESTS = [{
|
||||||
|
# Anvato backend
|
||||||
|
'url': 'http://losangeles.cbslocal.com/2016/05/16/safety-advocates-say-fatal-car-seat-failures-are-public-health-crisis',
|
||||||
|
'md5': 'f0ee3081e3843f575fccef901199b212',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '3401037',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Safety Advocates Say Fatal Car Seat Failures Are \'Public Health Crisis\'',
|
||||||
|
'description': 'Collapsing seats have been the focus of scrutiny for decades, though experts say remarkably little has been done to address the issue. Randy Paige reports.',
|
||||||
|
'thumbnail': 're:^https?://.*',
|
||||||
|
'timestamp': 1463440500,
|
||||||
|
'upload_date': '20160516',
|
||||||
|
'subtitles': {
|
||||||
|
'en': 'mincount:5',
|
||||||
|
},
|
||||||
|
'categories': [
|
||||||
|
'Stations\\Spoken Word\\KCBSTV',
|
||||||
|
'Syndication\\MSN',
|
||||||
|
'Syndication\\NDN',
|
||||||
|
'Syndication\\AOL',
|
||||||
|
'Syndication\\Yahoo',
|
||||||
|
'Syndication\\Tribune',
|
||||||
|
'Syndication\\Curb.tv',
|
||||||
|
'Content\\News'
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
# SendtoNews embed
|
||||||
|
'url': 'http://cleveland.cbslocal.com/2016/05/16/indians-score-season-high-15-runs-in-blowout-win-over-reds-rapid-reaction/',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'GxfCe0Zo7D-175909-5588',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Recap: CLE 15, CIN 6',
|
||||||
|
'description': '5/16/16: Indians\' bats explode for 15 runs in a win',
|
||||||
|
'upload_date': '20160516',
|
||||||
|
'timestamp': 1463433840,
|
||||||
|
'duration': 49,
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
# m3u8 download
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
display_id = self._match_id(url)
|
||||||
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
|
||||||
|
sendtonews_url = SendtoNewsIE._extract_url(webpage)
|
||||||
|
if sendtonews_url:
|
||||||
|
info_dict = {
|
||||||
|
'_type': 'url_transparent',
|
||||||
|
'url': compat_urlparse.urljoin(url, sendtonews_url),
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
info_dict = self._extract_anvato_videos(webpage, display_id)
|
||||||
|
|
||||||
|
time_str = self._html_search_regex(
|
||||||
|
r'class="entry-date">([^<]+)<', webpage, 'released date', fatal=False)
|
||||||
|
timestamp = None
|
||||||
|
if time_str:
|
||||||
|
timestamp = calendar.timegm(datetime.datetime.strptime(
|
||||||
|
time_str, '%b %d, %Y %I:%M %p').timetuple())
|
||||||
|
|
||||||
|
info_dict.update({
|
||||||
|
'display_id': display_id,
|
||||||
|
'timestamp': timestamp,
|
||||||
|
})
|
||||||
|
|
||||||
|
return info_dict
|
||||||
@@ -30,9 +30,12 @@ class CBSNewsIE(CBSBaseIE):
|
|||||||
{
|
{
|
||||||
'url': 'http://www.cbsnews.com/videos/fort-hood-shooting-army-downplays-mental-illness-as-cause-of-attack/',
|
'url': 'http://www.cbsnews.com/videos/fort-hood-shooting-army-downplays-mental-illness-as-cause-of-attack/',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'fort-hood-shooting-army-downplays-mental-illness-as-cause-of-attack',
|
'id': 'SNJBOYzXiWBOvaLsdzwH8fmtP1SCd91Y',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Fort Hood shooting: Army downplays mental illness as cause of attack',
|
'title': 'Fort Hood shooting: Army downplays mental illness as cause of attack',
|
||||||
|
'description': 'md5:4a6983e480542d8b333a947bfc64ddc7',
|
||||||
|
'upload_date': '19700101',
|
||||||
|
'uploader': 'CBSI-NEW',
|
||||||
'thumbnail': 're:^https?://.*\.jpg$',
|
'thumbnail': 're:^https?://.*\.jpg$',
|
||||||
'duration': 205,
|
'duration': 205,
|
||||||
'subtitles': {
|
'subtitles': {
|
||||||
@@ -58,30 +61,8 @@ class CBSNewsIE(CBSBaseIE):
|
|||||||
webpage, 'video JSON info'), video_id)
|
webpage, 'video JSON info'), video_id)
|
||||||
|
|
||||||
item = video_info['item'] if 'item' in video_info else video_info
|
item = video_info['item'] if 'item' in video_info else video_info
|
||||||
title = item.get('articleTitle') or item.get('hed')
|
guid = item['mpxRefId']
|
||||||
duration = item.get('duration')
|
return self._extract_video_info('byGuid=%s' % guid, guid)
|
||||||
thumbnail = item.get('mediaImage') or item.get('thumbnail')
|
|
||||||
|
|
||||||
subtitles = {}
|
|
||||||
formats = []
|
|
||||||
for format_id in ['RtmpMobileLow', 'RtmpMobileHigh', 'Hls', 'RtmpDesktop']:
|
|
||||||
pid = item.get('media' + format_id)
|
|
||||||
if not pid:
|
|
||||||
continue
|
|
||||||
release_url = 'http://link.theplatform.com/s/dJ5BDC/%s?mbr=true' % pid
|
|
||||||
tp_formats, tp_subtitles = self._extract_theplatform_smil(release_url, video_id, 'Downloading %s SMIL data' % pid)
|
|
||||||
formats.extend(tp_formats)
|
|
||||||
subtitles = self._merge_subtitles(subtitles, tp_subtitles)
|
|
||||||
self._sort_formats(formats)
|
|
||||||
|
|
||||||
return {
|
|
||||||
'id': video_id,
|
|
||||||
'title': title,
|
|
||||||
'thumbnail': thumbnail,
|
|
||||||
'duration': duration,
|
|
||||||
'formats': formats,
|
|
||||||
'subtitles': subtitles,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class CBSNewsLiveVideoIE(InfoExtractor):
|
class CBSNewsLiveVideoIE(InfoExtractor):
|
||||||
|
|||||||
@@ -1,30 +1,28 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
from .cbs import CBSBaseIE
|
||||||
|
|
||||||
from .common import InfoExtractor
|
|
||||||
|
|
||||||
|
|
||||||
class CBSSportsIE(InfoExtractor):
|
class CBSSportsIE(CBSBaseIE):
|
||||||
_VALID_URL = r'https?://www\.cbssports\.com/video/player/(?P<section>[^/]+)/(?P<id>[^/]+)'
|
_VALID_URL = r'https?://www\.cbssports\.com/video/player/[^/]+/(?P<id>\d+)'
|
||||||
|
|
||||||
_TEST = {
|
_TESTS = [{
|
||||||
'url': 'http://www.cbssports.com/video/player/tennis/318462531970/0/us-open-flashbacks-1990s',
|
'url': 'http://www.cbssports.com/video/player/videos/708337219968/0/ben-simmons-the-next-lebron?-not-so-fast',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '_d5_GbO8p1sT',
|
'id': '708337219968',
|
||||||
'ext': 'flv',
|
'ext': 'mp4',
|
||||||
'title': 'US Open flashbacks: 1990s',
|
'title': 'Ben Simmons the next LeBron? Not so fast',
|
||||||
'description': 'Bill Macatee relives the best moments in US Open history from the 1990s.',
|
'description': 'md5:854294f627921baba1f4b9a990d87197',
|
||||||
|
'timestamp': 1466293740,
|
||||||
|
'upload_date': '20160618',
|
||||||
|
'uploader': 'CBSI-NEW',
|
||||||
},
|
},
|
||||||
}
|
'params': {
|
||||||
|
# m3u8 download
|
||||||
|
'skip_download': True,
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
video_id = self._match_id(url)
|
||||||
section = mobj.group('section')
|
return self._extract_video_info('byId=%s' % video_id, video_id)
|
||||||
video_id = mobj.group('id')
|
|
||||||
all_videos = self._download_json(
|
|
||||||
'http://www.cbssports.com/data/video/player/getVideos/%s?as=json' % section,
|
|
||||||
video_id)
|
|
||||||
# The json file contains the info of all the videos in the section
|
|
||||||
video_info = next(v for v in all_videos if v['pcid'] == video_id)
|
|
||||||
return self.url_result('theplatform:%s' % video_info['pid'], 'ThePlatform')
|
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
int_or_none,
|
int_or_none,
|
||||||
parse_duration,
|
parse_iso8601,
|
||||||
qualities,
|
|
||||||
unified_strdate,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -19,14 +15,14 @@ class CCCIE(InfoExtractor):
|
|||||||
'url': 'https://media.ccc.de/v/30C3_-_5443_-_en_-_saal_g_-_201312281830_-_introduction_to_processor_design_-_byterazor#video',
|
'url': 'https://media.ccc.de/v/30C3_-_5443_-_en_-_saal_g_-_201312281830_-_introduction_to_processor_design_-_byterazor#video',
|
||||||
'md5': '3a1eda8f3a29515d27f5adb967d7e740',
|
'md5': '3a1eda8f3a29515d27f5adb967d7e740',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '30C3_-_5443_-_en_-_saal_g_-_201312281830_-_introduction_to_processor_design_-_byterazor',
|
'id': '1839',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Introduction to Processor Design',
|
'title': 'Introduction to Processor Design',
|
||||||
'description': 'md5:80be298773966f66d56cb11260b879af',
|
'description': 'md5:df55f6d073d4ceae55aae6f2fd98a0ac',
|
||||||
'thumbnail': 're:^https?://.*\.jpg$',
|
'thumbnail': 're:^https?://.*\.jpg$',
|
||||||
'view_count': int,
|
|
||||||
'upload_date': '20131228',
|
'upload_date': '20131228',
|
||||||
'duration': 3660,
|
'timestamp': 1388188800,
|
||||||
|
'duration': 3710,
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://media.ccc.de/v/32c3-7368-shopshifting#download',
|
'url': 'https://media.ccc.de/v/32c3-7368-shopshifting#download',
|
||||||
@@ -34,79 +30,48 @@ class CCCIE(InfoExtractor):
|
|||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
display_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
event_id = self._search_regex("data-id='(\d+)'", webpage, 'event id')
|
||||||
|
event_data = self._download_json('https://media.ccc.de/public/events/%s' % event_id, event_id)
|
||||||
|
|
||||||
if self._downloader.params.get('prefer_free_formats'):
|
|
||||||
preference = qualities(['mp3', 'opus', 'mp4-lq', 'webm-lq', 'h264-sd', 'mp4-sd', 'webm-sd', 'mp4', 'webm', 'mp4-hd', 'h264-hd', 'webm-hd'])
|
|
||||||
else:
|
|
||||||
preference = qualities(['opus', 'mp3', 'webm-lq', 'mp4-lq', 'webm-sd', 'h264-sd', 'mp4-sd', 'webm', 'mp4', 'webm-hd', 'mp4-hd', 'h264-hd'])
|
|
||||||
|
|
||||||
title = self._html_search_regex(
|
|
||||||
r'(?s)<h1>(.*?)</h1>', webpage, 'title')
|
|
||||||
description = self._html_search_regex(
|
|
||||||
r'(?s)<h3>About</h3>(.+?)<h3>',
|
|
||||||
webpage, 'description', fatal=False)
|
|
||||||
upload_date = unified_strdate(self._html_search_regex(
|
|
||||||
r"(?s)<span[^>]+class='[^']*fa-calendar-o'[^>]*>(.+?)</span>",
|
|
||||||
webpage, 'upload date', fatal=False))
|
|
||||||
view_count = int_or_none(self._html_search_regex(
|
|
||||||
r"(?s)<span class='[^']*fa-eye'></span>(.*?)</li>",
|
|
||||||
webpage, 'view count', fatal=False))
|
|
||||||
duration = parse_duration(self._html_search_regex(
|
|
||||||
r'(?s)<span[^>]+class=(["\']).*?fa-clock-o.*?\1[^>]*></span>(?P<duration>.+?)</li',
|
|
||||||
webpage, 'duration', fatal=False, group='duration'))
|
|
||||||
|
|
||||||
matches = re.finditer(r'''(?xs)
|
|
||||||
<(?:span|div)\s+class='label\s+filetype'>(?P<format>[^<]*)</(?:span|div)>\s*
|
|
||||||
<(?:span|div)\s+class='label\s+filetype'>(?P<lang>[^<]*)</(?:span|div)>\s*
|
|
||||||
<a\s+download\s+href='(?P<http_url>[^']+)'>\s*
|
|
||||||
(?:
|
|
||||||
.*?
|
|
||||||
<a\s+(?:download\s+)?href='(?P<torrent_url>[^']+\.torrent)'
|
|
||||||
)?''', webpage)
|
|
||||||
formats = []
|
formats = []
|
||||||
for m in matches:
|
for recording in event_data.get('recordings', []):
|
||||||
format = m.group('format')
|
recording_url = recording.get('recording_url')
|
||||||
format_id = self._search_regex(
|
if not recording_url:
|
||||||
r'.*/([a-z0-9_-]+)/[^/]*$',
|
continue
|
||||||
m.group('http_url'), 'format id', default=None)
|
language = recording.get('language')
|
||||||
if format_id:
|
folder = recording.get('folder')
|
||||||
format_id = m.group('lang') + '-' + format_id
|
format_id = None
|
||||||
vcodec = 'h264' if 'h264' in format_id else (
|
if language:
|
||||||
'none' if format_id in ('mp3', 'opus') else None
|
format_id = language
|
||||||
|
if folder:
|
||||||
|
if language:
|
||||||
|
format_id += '-' + folder
|
||||||
|
else:
|
||||||
|
format_id = folder
|
||||||
|
vcodec = 'h264' if 'h264' in folder else (
|
||||||
|
'none' if folder in ('mp3', 'opus') else None
|
||||||
)
|
)
|
||||||
formats.append({
|
formats.append({
|
||||||
'format_id': format_id,
|
'format_id': format_id,
|
||||||
'format': format,
|
'url': recording_url,
|
||||||
'language': m.group('lang'),
|
'width': int_or_none(recording.get('width')),
|
||||||
'url': m.group('http_url'),
|
'height': int_or_none(recording.get('height')),
|
||||||
|
'filesize': int_or_none(recording.get('size'), invscale=1024 * 1024),
|
||||||
|
'language': language,
|
||||||
'vcodec': vcodec,
|
'vcodec': vcodec,
|
||||||
'preference': preference(format_id),
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if m.group('torrent_url'):
|
|
||||||
formats.append({
|
|
||||||
'format_id': 'torrent-%s' % (format if format_id is None else format_id),
|
|
||||||
'format': '%s (torrent)' % format,
|
|
||||||
'proto': 'torrent',
|
|
||||||
'format_note': '(unsupported; will just download the .torrent file)',
|
|
||||||
'vcodec': vcodec,
|
|
||||||
'preference': -100 + preference(format_id),
|
|
||||||
'url': m.group('torrent_url'),
|
|
||||||
})
|
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
thumbnail = self._html_search_regex(
|
|
||||||
r"<video.*?poster='([^']+)'", webpage, 'thumbnail', fatal=False)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': event_id,
|
||||||
'title': title,
|
'display_id': display_id,
|
||||||
'description': description,
|
'title': event_data['title'],
|
||||||
'thumbnail': thumbnail,
|
'description': event_data.get('description'),
|
||||||
'view_count': view_count,
|
'thumbnail': event_data.get('thumb_url'),
|
||||||
'upload_date': upload_date,
|
'timestamp': parse_iso8601(event_data.get('date')),
|
||||||
'duration': duration,
|
'duration': int_or_none(event_data.get('length')),
|
||||||
|
'tags': event_data.get('tags'),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,8 @@ class CDAIE(InfoExtractor):
|
|||||||
def extract_format(page, version):
|
def extract_format(page, version):
|
||||||
unpacked = decode_packed_codes(page)
|
unpacked = decode_packed_codes(page)
|
||||||
format_url = self._search_regex(
|
format_url = self._search_regex(
|
||||||
r"url:\\'(.+?)\\'", unpacked, '%s url' % version, fatal=False)
|
r"(?:file|url)\s*:\s*(\\?[\"'])(?P<url>http.+?)\1", unpacked,
|
||||||
|
'%s url' % version, fatal=False, group='url')
|
||||||
if not format_url:
|
if not format_url:
|
||||||
return
|
return
|
||||||
f = {
|
f = {
|
||||||
@@ -75,7 +76,8 @@ class CDAIE(InfoExtractor):
|
|||||||
info_dict['formats'].append(f)
|
info_dict['formats'].append(f)
|
||||||
if not info_dict['duration']:
|
if not info_dict['duration']:
|
||||||
info_dict['duration'] = parse_duration(self._search_regex(
|
info_dict['duration'] = parse_duration(self._search_regex(
|
||||||
r"duration:\\'(.+?)\\'", unpacked, 'duration', fatal=False))
|
r"duration\s*:\s*(\\?[\"'])(?P<duration>.+?)\1",
|
||||||
|
unpacked, 'duration', fatal=False, group='duration'))
|
||||||
|
|
||||||
extract_format(webpage, 'default')
|
extract_format(webpage, 'default')
|
||||||
|
|
||||||
|
|||||||
@@ -33,19 +33,33 @@ class CeskaTelevizeIE(InfoExtractor):
|
|||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.ceskatelevize.cz/ivysilani/10532695142-prvni-republika/bonus/14716-zpevacka-z-duparny-bobina',
|
'url': 'http://www.ceskatelevize.cz/ivysilani/10441294653-hyde-park-civilizace/215411058090502/bonus/20641-bonus-01-en',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '61924494876844374',
|
'id': '61924494877028507',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'První republika: Zpěvačka z Dupárny Bobina',
|
'title': 'Hyde Park Civilizace: Bonus 01 - En',
|
||||||
'description': 'Sága mapující atmosféru první republiky od r. 1918 do r. 1945.',
|
'description': 'English Subtittles',
|
||||||
'thumbnail': 're:^https?://.*\.jpg',
|
'thumbnail': 're:^https?://.*\.jpg',
|
||||||
'duration': 88.4,
|
'duration': 81.3,
|
||||||
},
|
},
|
||||||
'params': {
|
'params': {
|
||||||
# m3u8 download
|
# m3u8 download
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
|
}, {
|
||||||
|
# live stream
|
||||||
|
'url': 'http://www.ceskatelevize.cz/ivysilani/zive/ct4/',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 402,
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 're:^ČT Sport \d{4}-\d{2}-\d{2} \d{2}:\d{2}$',
|
||||||
|
'is_live': True,
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
# m3u8 download
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
'skip': 'Georestricted to Czech Republic',
|
||||||
}, {
|
}, {
|
||||||
# video with 18+ caution trailer
|
# video with 18+ caution trailer
|
||||||
'url': 'http://www.ceskatelevize.cz/porady/10520528904-queer/215562210900007-bogotart/',
|
'url': 'http://www.ceskatelevize.cz/porady/10520528904-queer/215562210900007-bogotart/',
|
||||||
@@ -118,19 +132,21 @@ class CeskaTelevizeIE(InfoExtractor):
|
|||||||
req = sanitized_Request(compat_urllib_parse_unquote(playlist_url))
|
req = sanitized_Request(compat_urllib_parse_unquote(playlist_url))
|
||||||
req.add_header('Referer', url)
|
req.add_header('Referer', url)
|
||||||
|
|
||||||
playlist_title = self._og_search_title(webpage)
|
playlist_title = self._og_search_title(webpage, default=None)
|
||||||
playlist_description = self._og_search_description(webpage)
|
playlist_description = self._og_search_description(webpage, default=None)
|
||||||
|
|
||||||
playlist = self._download_json(req, playlist_id)['playlist']
|
playlist = self._download_json(req, playlist_id)['playlist']
|
||||||
playlist_len = len(playlist)
|
playlist_len = len(playlist)
|
||||||
|
|
||||||
entries = []
|
entries = []
|
||||||
for item in playlist:
|
for item in playlist:
|
||||||
|
is_live = item.get('type') == 'LIVE'
|
||||||
formats = []
|
formats = []
|
||||||
for format_id, stream_url in item['streamUrls'].items():
|
for format_id, stream_url in item['streamUrls'].items():
|
||||||
formats.extend(self._extract_m3u8_formats(
|
formats.extend(self._extract_m3u8_formats(
|
||||||
stream_url, playlist_id, 'mp4',
|
stream_url, playlist_id, 'mp4',
|
||||||
entry_protocol='m3u8_native', fatal=False))
|
entry_protocol='m3u8' if is_live else 'm3u8_native',
|
||||||
|
fatal=False))
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
item_id = item.get('id') or item['assetId']
|
item_id = item.get('id') or item['assetId']
|
||||||
@@ -145,14 +161,22 @@ class CeskaTelevizeIE(InfoExtractor):
|
|||||||
if subs:
|
if subs:
|
||||||
subtitles = self.extract_subtitles(episode_id, subs)
|
subtitles = self.extract_subtitles(episode_id, subs)
|
||||||
|
|
||||||
|
if playlist_len == 1:
|
||||||
|
final_title = playlist_title or title
|
||||||
|
if is_live:
|
||||||
|
final_title = self._live_title(final_title)
|
||||||
|
else:
|
||||||
|
final_title = '%s (%s)' % (playlist_title, title)
|
||||||
|
|
||||||
entries.append({
|
entries.append({
|
||||||
'id': item_id,
|
'id': item_id,
|
||||||
'title': playlist_title if playlist_len == 1 else '%s (%s)' % (playlist_title, title),
|
'title': final_title,
|
||||||
'description': playlist_description if playlist_len == 1 else None,
|
'description': playlist_description if playlist_len == 1 else None,
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': thumbnail,
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
|
'is_live': is_live,
|
||||||
})
|
})
|
||||||
|
|
||||||
return self.playlist_result(entries, playlist_id, playlist_title, playlist_description)
|
return self.playlist_result(entries, playlist_id, playlist_title, playlist_description)
|
||||||
|
|||||||
@@ -20,54 +20,64 @@ class Channel9IE(InfoExtractor):
|
|||||||
'''
|
'''
|
||||||
IE_DESC = 'Channel 9'
|
IE_DESC = 'Channel 9'
|
||||||
IE_NAME = 'channel9'
|
IE_NAME = 'channel9'
|
||||||
_VALID_URL = r'https?://(?:www\.)?channel9\.msdn\.com/(?P<contentpath>.+)/?'
|
_VALID_URL = r'https?://(?:www\.)?channel9\.msdn\.com/(?P<contentpath>.+?)(?P<rss>/RSS)?/?(?:[?#&]|$)'
|
||||||
|
|
||||||
_TESTS = [
|
_TESTS = [{
|
||||||
{
|
'url': 'http://channel9.msdn.com/Events/TechEd/Australia/2013/KOS002',
|
||||||
'url': 'http://channel9.msdn.com/Events/TechEd/Australia/2013/KOS002',
|
'md5': 'bbd75296ba47916b754e73c3a4bbdf10',
|
||||||
'md5': 'bbd75296ba47916b754e73c3a4bbdf10',
|
'info_dict': {
|
||||||
'info_dict': {
|
'id': 'Events/TechEd/Australia/2013/KOS002',
|
||||||
'id': 'Events/TechEd/Australia/2013/KOS002',
|
'ext': 'mp4',
|
||||||
'ext': 'mp4',
|
'title': 'Developer Kick-Off Session: Stuff We Love',
|
||||||
'title': 'Developer Kick-Off Session: Stuff We Love',
|
'description': 'md5:c08d72240b7c87fcecafe2692f80e35f',
|
||||||
'description': 'md5:c08d72240b7c87fcecafe2692f80e35f',
|
'duration': 4576,
|
||||||
'duration': 4576,
|
'thumbnail': 're:http://.*\.jpg',
|
||||||
'thumbnail': 're:http://.*\.jpg',
|
'session_code': 'KOS002',
|
||||||
'session_code': 'KOS002',
|
'session_day': 'Day 1',
|
||||||
'session_day': 'Day 1',
|
'session_room': 'Arena 1A',
|
||||||
'session_room': 'Arena 1A',
|
'session_speakers': ['Ed Blankenship', 'Andrew Coates', 'Brady Gaster', 'Patrick Klug',
|
||||||
'session_speakers': ['Ed Blankenship', 'Andrew Coates', 'Brady Gaster', 'Patrick Klug', 'Mads Kristensen'],
|
'Mads Kristensen'],
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
}, {
|
||||||
'url': 'http://channel9.msdn.com/posts/Self-service-BI-with-Power-BI-nuclear-testing',
|
'url': 'http://channel9.msdn.com/posts/Self-service-BI-with-Power-BI-nuclear-testing',
|
||||||
'md5': 'b43ee4529d111bc37ba7ee4f34813e68',
|
'md5': 'b43ee4529d111bc37ba7ee4f34813e68',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'posts/Self-service-BI-with-Power-BI-nuclear-testing',
|
'id': 'posts/Self-service-BI-with-Power-BI-nuclear-testing',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Self-service BI with Power BI - nuclear testing',
|
'title': 'Self-service BI with Power BI - nuclear testing',
|
||||||
'description': 'md5:d1e6ecaafa7fb52a2cacdf9599829f5b',
|
'description': 'md5:d1e6ecaafa7fb52a2cacdf9599829f5b',
|
||||||
'duration': 1540,
|
'duration': 1540,
|
||||||
'thumbnail': 're:http://.*\.jpg',
|
'thumbnail': 're:http://.*\.jpg',
|
||||||
'authors': ['Mike Wilmot'],
|
'authors': ['Mike Wilmot'],
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
}, {
|
||||||
# low quality mp4 is best
|
# low quality mp4 is best
|
||||||
'url': 'https://channel9.msdn.com/Events/CPP/CppCon-2015/Ranges-for-the-Standard-Library',
|
'url': 'https://channel9.msdn.com/Events/CPP/CppCon-2015/Ranges-for-the-Standard-Library',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'Events/CPP/CppCon-2015/Ranges-for-the-Standard-Library',
|
'id': 'Events/CPP/CppCon-2015/Ranges-for-the-Standard-Library',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Ranges for the Standard Library',
|
'title': 'Ranges for the Standard Library',
|
||||||
'description': 'md5:2e6b4917677af3728c5f6d63784c4c5d',
|
'description': 'md5:2e6b4917677af3728c5f6d63784c4c5d',
|
||||||
'duration': 5646,
|
'duration': 5646,
|
||||||
'thumbnail': 're:http://.*\.jpg',
|
'thumbnail': 're:http://.*\.jpg',
|
||||||
},
|
},
|
||||||
'params': {
|
'params': {
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
}
|
}, {
|
||||||
]
|
'url': 'https://channel9.msdn.com/Niners/Splendid22/Queue/76acff796e8f411184b008028e0d492b/RSS',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'Niners/Splendid22/Queue/76acff796e8f411184b008028e0d492b',
|
||||||
|
'title': 'Channel 9',
|
||||||
|
},
|
||||||
|
'playlist_count': 2,
|
||||||
|
}, {
|
||||||
|
'url': 'https://channel9.msdn.com/Events/DEVintersection/DEVintersection-2016/RSS',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'https://channel9.msdn.com/Events/Speakers/scott-hanselman/RSS?UrlSafeName=scott-hanselman',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
_RSS_URL = 'http://channel9.msdn.com/%s/RSS'
|
_RSS_URL = 'http://channel9.msdn.com/%s/RSS'
|
||||||
|
|
||||||
@@ -254,22 +264,30 @@ class Channel9IE(InfoExtractor):
|
|||||||
|
|
||||||
return self.playlist_result(contents)
|
return self.playlist_result(contents)
|
||||||
|
|
||||||
def _extract_list(self, content_path):
|
def _extract_list(self, video_id, rss_url=None):
|
||||||
rss = self._download_xml(self._RSS_URL % content_path, content_path, 'Downloading RSS')
|
if not rss_url:
|
||||||
|
rss_url = self._RSS_URL % video_id
|
||||||
|
rss = self._download_xml(rss_url, video_id, 'Downloading RSS')
|
||||||
entries = [self.url_result(session_url.text, 'Channel9')
|
entries = [self.url_result(session_url.text, 'Channel9')
|
||||||
for session_url in rss.findall('./channel/item/link')]
|
for session_url in rss.findall('./channel/item/link')]
|
||||||
title_text = rss.find('./channel/title').text
|
title_text = rss.find('./channel/title').text
|
||||||
return self.playlist_result(entries, content_path, title_text)
|
return self.playlist_result(entries, video_id, title_text)
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
content_path = mobj.group('contentpath')
|
content_path = mobj.group('contentpath')
|
||||||
|
rss = mobj.group('rss')
|
||||||
|
|
||||||
webpage = self._download_webpage(url, content_path, 'Downloading web page')
|
if rss:
|
||||||
|
return self._extract_list(content_path, url)
|
||||||
|
|
||||||
page_type_m = re.search(r'<meta name="WT.entryid" content="(?P<pagetype>[^:]+)[^"]+"/>', webpage)
|
webpage = self._download_webpage(
|
||||||
if page_type_m is not None:
|
url, content_path, 'Downloading web page')
|
||||||
page_type = page_type_m.group('pagetype')
|
|
||||||
|
page_type = self._search_regex(
|
||||||
|
r'<meta[^>]+name=(["\'])WT\.entryid\1[^>]+content=(["\'])(?P<pagetype>[^:]+).+?\2',
|
||||||
|
webpage, 'page type', default=None, group='pagetype')
|
||||||
|
if page_type:
|
||||||
if page_type == 'Entry': # Any 'item'-like page, may contain downloadable content
|
if page_type == 'Entry': # Any 'item'-like page, may contain downloadable content
|
||||||
return self._extract_entry_item(webpage, content_path)
|
return self._extract_entry_item(webpage, content_path)
|
||||||
elif page_type == 'Session': # Event session page, may contain downloadable content
|
elif page_type == 'Session': # Event session page, may contain downloadable content
|
||||||
@@ -278,6 +296,5 @@ class Channel9IE(InfoExtractor):
|
|||||||
return self._extract_list(content_path)
|
return self._extract_list(content_path)
|
||||||
else:
|
else:
|
||||||
raise ExtractorError('Unexpected WT.entryid %s' % page_type, expected=True)
|
raise ExtractorError('Unexpected WT.entryid %s' % page_type, expected=True)
|
||||||
|
|
||||||
else: # Assuming list
|
else: # Assuming list
|
||||||
return self._extract_list(content_path)
|
return self._extract_list(content_path)
|
||||||
|
|||||||
@@ -1,119 +0,0 @@
|
|||||||
# encoding: utf-8
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
|
||||||
from ..utils import ExtractorError
|
|
||||||
from .screenwavemedia import ScreenwaveMediaIE
|
|
||||||
|
|
||||||
|
|
||||||
class CinemassacreIE(InfoExtractor):
|
|
||||||
_VALID_URL = 'https?://(?:www\.)?cinemassacre\.com/(?P<date_y>[0-9]{4})/(?P<date_m>[0-9]{2})/(?P<date_d>[0-9]{2})/(?P<display_id>[^?#/]+)'
|
|
||||||
_TESTS = [
|
|
||||||
{
|
|
||||||
'url': 'http://cinemassacre.com/2012/11/10/avgn-the-movie-trailer/',
|
|
||||||
'md5': 'fde81fbafaee331785f58cd6c0d46190',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'Cinemassacre-19911',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'upload_date': '20121110',
|
|
||||||
'title': '“Angry Video Game Nerd: The Movie” – Trailer',
|
|
||||||
'description': 'md5:fb87405fcb42a331742a0dce2708560b',
|
|
||||||
},
|
|
||||||
'params': {
|
|
||||||
# m3u8 download
|
|
||||||
'skip_download': True,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'url': 'http://cinemassacre.com/2013/10/02/the-mummys-hand-1940',
|
|
||||||
'md5': 'd72f10cd39eac4215048f62ab477a511',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'Cinemassacre-521be8ef82b16',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'upload_date': '20131002',
|
|
||||||
'title': 'The Mummy’s Hand (1940)',
|
|
||||||
},
|
|
||||||
'params': {
|
|
||||||
# m3u8 download
|
|
||||||
'skip_download': True,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
# Youtube embedded video
|
|
||||||
'url': 'http://cinemassacre.com/2006/12/07/chronologically-confused-about-bad-movie-and-video-game-sequel-titles/',
|
|
||||||
'md5': 'ec9838a5520ef5409b3e4e42fcb0a3b9',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'OEVzPCY2T-g',
|
|
||||||
'ext': 'webm',
|
|
||||||
'title': 'AVGN: Chronologically Confused about Bad Movie and Video Game Sequel Titles',
|
|
||||||
'upload_date': '20061207',
|
|
||||||
'uploader': 'Cinemassacre',
|
|
||||||
'uploader_id': 'JamesNintendoNerd',
|
|
||||||
'description': 'md5:784734696c2b8b7f4b8625cc799e07f6',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
# Youtube embedded video
|
|
||||||
'url': 'http://cinemassacre.com/2006/09/01/mckids/',
|
|
||||||
'md5': '7393c4e0f54602ad110c793eb7a6513a',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'FnxsNhuikpo',
|
|
||||||
'ext': 'webm',
|
|
||||||
'upload_date': '20060901',
|
|
||||||
'uploader': 'Cinemassacre Extra',
|
|
||||||
'description': 'md5:de9b751efa9e45fbaafd9c8a1123ed53',
|
|
||||||
'uploader_id': 'Cinemassacre',
|
|
||||||
'title': 'AVGN: McKids',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'url': 'http://cinemassacre.com/2015/05/25/mario-kart-64-nintendo-64-james-mike-mondays/',
|
|
||||||
'md5': '1376908e49572389e7b06251a53cdd08',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'Cinemassacre-555779690c440',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'description': 'Let’s Play Mario Kart 64 !! Mario Kart 64 is a classic go-kart racing game released for the Nintendo 64 (N64). Today James & Mike do 4 player Battle Mode with Kyle and Bootsy!',
|
|
||||||
'title': 'Mario Kart 64 (Nintendo 64) James & Mike Mondays',
|
|
||||||
'upload_date': '20150525',
|
|
||||||
},
|
|
||||||
'params': {
|
|
||||||
# m3u8 download
|
|
||||||
'skip_download': True,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
mobj = re.match(self._VALID_URL, url)
|
|
||||||
display_id = mobj.group('display_id')
|
|
||||||
video_date = mobj.group('date_y') + mobj.group('date_m') + mobj.group('date_d')
|
|
||||||
|
|
||||||
webpage = self._download_webpage(url, display_id)
|
|
||||||
|
|
||||||
playerdata_url = self._search_regex(
|
|
||||||
[
|
|
||||||
ScreenwaveMediaIE.EMBED_PATTERN,
|
|
||||||
r'<iframe[^>]+src="(?P<url>(?:https?:)?//(?:[^.]+\.)?youtube\.com/.+?)"',
|
|
||||||
],
|
|
||||||
webpage, 'player data URL', default=None, group='url')
|
|
||||||
if not playerdata_url:
|
|
||||||
raise ExtractorError('Unable to find player data')
|
|
||||||
|
|
||||||
video_title = self._html_search_regex(
|
|
||||||
r'<title>(?P<title>.+?)\|', webpage, 'title')
|
|
||||||
video_description = self._html_search_regex(
|
|
||||||
r'<div class="entry-content">(?P<description>.+?)</div>',
|
|
||||||
webpage, 'description', flags=re.DOTALL, fatal=False)
|
|
||||||
video_thumbnail = self._og_search_thumbnail(webpage)
|
|
||||||
|
|
||||||
return {
|
|
||||||
'_type': 'url_transparent',
|
|
||||||
'display_id': display_id,
|
|
||||||
'title': video_title,
|
|
||||||
'description': video_description,
|
|
||||||
'upload_date': video_date,
|
|
||||||
'thumbnail': video_thumbnail,
|
|
||||||
'url': playerdata_url,
|
|
||||||
}
|
|
||||||
90
youtube_dl/extractor/cliprs.py
Normal file
90
youtube_dl/extractor/cliprs.py
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
ExtractorError,
|
||||||
|
float_or_none,
|
||||||
|
int_or_none,
|
||||||
|
parse_iso8601,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class ClipRsIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?clip\.rs/(?P<id>[^/]+)/\d+'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'http://www.clip.rs/premijera-frajle-predstavljaju-novi-spot-za-pesmu-moli-me-moli/3732',
|
||||||
|
'md5': 'c412d57815ba07b56f9edc7b5d6a14e5',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '1488842.1399140381',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'PREMIJERA Frajle predstavljaju novi spot za pesmu Moli me, moli',
|
||||||
|
'description': 'md5:56ce2c3b4ab31c5a2e0b17cb9a453026',
|
||||||
|
'duration': 229,
|
||||||
|
'timestamp': 1459850243,
|
||||||
|
'upload_date': '20160405',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
|
video_id = self._search_regex(
|
||||||
|
r'id=(["\'])mvp:(?P<id>.+?)\1', webpage, 'mvp id', group='id')
|
||||||
|
|
||||||
|
response = self._download_json(
|
||||||
|
'http://qi.ckm.onetapi.pl/', video_id,
|
||||||
|
query={
|
||||||
|
'body[id]': video_id,
|
||||||
|
'body[jsonrpc]': '2.0',
|
||||||
|
'body[method]': 'get_asset_detail',
|
||||||
|
'body[params][ID_Publikacji]': video_id,
|
||||||
|
'body[params][Service]': 'www.onet.pl',
|
||||||
|
'content-type': 'application/jsonp',
|
||||||
|
'x-onet-app': 'player.front.onetapi.pl',
|
||||||
|
})
|
||||||
|
|
||||||
|
error = response.get('error')
|
||||||
|
if error:
|
||||||
|
raise ExtractorError(
|
||||||
|
'%s said: %s' % (self.IE_NAME, error['message']), expected=True)
|
||||||
|
|
||||||
|
video = response['result'].get('0')
|
||||||
|
|
||||||
|
formats = []
|
||||||
|
for _, formats_dict in video['formats'].items():
|
||||||
|
if not isinstance(formats_dict, dict):
|
||||||
|
continue
|
||||||
|
for format_id, format_list in formats_dict.items():
|
||||||
|
if not isinstance(format_list, list):
|
||||||
|
continue
|
||||||
|
for f in format_list:
|
||||||
|
if not f.get('url'):
|
||||||
|
continue
|
||||||
|
formats.append({
|
||||||
|
'url': f['url'],
|
||||||
|
'format_id': format_id,
|
||||||
|
'height': int_or_none(f.get('vertical_resolution')),
|
||||||
|
'width': int_or_none(f.get('horizontal_resolution')),
|
||||||
|
'abr': float_or_none(f.get('audio_bitrate')),
|
||||||
|
'vbr': float_or_none(f.get('video_bitrate')),
|
||||||
|
})
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
meta = video.get('meta', {})
|
||||||
|
|
||||||
|
title = self._og_search_title(webpage, default=None) or meta['title']
|
||||||
|
description = self._og_search_description(webpage, default=None) or meta.get('description')
|
||||||
|
duration = meta.get('length') or meta.get('lenght')
|
||||||
|
timestamp = parse_iso8601(meta.get('addDate'), ' ')
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': title,
|
||||||
|
'description': description,
|
||||||
|
'duration': duration,
|
||||||
|
'timestamp': timestamp,
|
||||||
|
'formats': formats,
|
||||||
|
}
|
||||||
92
youtube_dl/extractor/closertotruth.py
Normal file
92
youtube_dl/extractor/closertotruth.py
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
|
class CloserToTruthIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?closertotruth\.com/(?:[^/]+/)*(?P<id>[^/?#&]+)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://closertotruth.com/series/solutions-the-mind-body-problem#video-3688',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '0_zof1ktre',
|
||||||
|
'display_id': 'solutions-the-mind-body-problem',
|
||||||
|
'ext': 'mov',
|
||||||
|
'title': 'Solutions to the Mind-Body Problem?',
|
||||||
|
'upload_date': '20140221',
|
||||||
|
'timestamp': 1392956007,
|
||||||
|
'uploader_id': 'CTTXML'
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'url': 'http://closertotruth.com/episodes/how-do-brains-work',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '0_iuxai6g6',
|
||||||
|
'display_id': 'how-do-brains-work',
|
||||||
|
'ext': 'mov',
|
||||||
|
'title': 'How do Brains Work?',
|
||||||
|
'upload_date': '20140221',
|
||||||
|
'timestamp': 1392956024,
|
||||||
|
'uploader_id': 'CTTXML'
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'url': 'http://closertotruth.com/interviews/1725',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '1725',
|
||||||
|
'title': 'AyaFr-002',
|
||||||
|
},
|
||||||
|
'playlist_mincount': 2,
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
display_id = self._match_id(url)
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
|
||||||
|
partner_id = self._search_regex(
|
||||||
|
r'<script[^>]+src=["\'].*?\b(?:partner_id|p)/(\d+)',
|
||||||
|
webpage, 'kaltura partner_id')
|
||||||
|
|
||||||
|
title = self._search_regex(
|
||||||
|
r'<title>(.+?)\s*\|\s*.+?</title>', webpage, 'video title')
|
||||||
|
|
||||||
|
select = self._search_regex(
|
||||||
|
r'(?s)<select[^>]+id="select-version"[^>]*>(.+?)</select>',
|
||||||
|
webpage, 'select version', default=None)
|
||||||
|
if select:
|
||||||
|
entry_ids = set()
|
||||||
|
entries = []
|
||||||
|
for mobj in re.finditer(
|
||||||
|
r'<option[^>]+value=(["\'])(?P<id>[0-9a-z_]+)(?:#.+?)?\1[^>]*>(?P<title>[^<]+)',
|
||||||
|
webpage):
|
||||||
|
entry_id = mobj.group('id')
|
||||||
|
if entry_id in entry_ids:
|
||||||
|
continue
|
||||||
|
entry_ids.add(entry_id)
|
||||||
|
entries.append({
|
||||||
|
'_type': 'url_transparent',
|
||||||
|
'url': 'kaltura:%s:%s' % (partner_id, entry_id),
|
||||||
|
'ie_key': 'Kaltura',
|
||||||
|
'title': mobj.group('title'),
|
||||||
|
})
|
||||||
|
if entries:
|
||||||
|
return self.playlist_result(entries, display_id, title)
|
||||||
|
|
||||||
|
entry_id = self._search_regex(
|
||||||
|
r'<a[^>]+id=(["\'])embed-kaltura\1[^>]+data-kaltura=(["\'])(?P<id>[0-9a-z_]+)\2',
|
||||||
|
webpage, 'kaltura entry_id', group='id')
|
||||||
|
|
||||||
|
return {
|
||||||
|
'_type': 'url_transparent',
|
||||||
|
'display_id': display_id,
|
||||||
|
'url': 'kaltura:%s:%s' % (partner_id, entry_id),
|
||||||
|
'ie_key': 'Kaltura',
|
||||||
|
'title': title
|
||||||
|
}
|
||||||
@@ -19,7 +19,7 @@ from ..utils import (
|
|||||||
class CloudyIE(InfoExtractor):
|
class CloudyIE(InfoExtractor):
|
||||||
_IE_DESC = 'cloudy.ec and videoraj.ch'
|
_IE_DESC = 'cloudy.ec and videoraj.ch'
|
||||||
_VALID_URL = r'''(?x)
|
_VALID_URL = r'''(?x)
|
||||||
https?://(?:www\.)?(?P<host>cloudy\.ec|videoraj\.ch)/
|
https?://(?:www\.)?(?P<host>cloudy\.ec|videoraj\.(?:ch|to))/
|
||||||
(?:v/|embed\.php\?id=)
|
(?:v/|embed\.php\?id=)
|
||||||
(?P<id>[A-Za-z0-9]+)
|
(?P<id>[A-Za-z0-9]+)
|
||||||
'''
|
'''
|
||||||
@@ -37,7 +37,7 @@ class CloudyIE(InfoExtractor):
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'url': 'http://www.videoraj.ch/v/47f399fd8bb60',
|
'url': 'http://www.videoraj.to/v/47f399fd8bb60',
|
||||||
'md5': '7d0f8799d91efd4eda26587421c3c3b0',
|
'md5': '7d0f8799d91efd4eda26587421c3c3b0',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '47f399fd8bb60',
|
'id': '47f399fd8bb60',
|
||||||
|
|||||||
@@ -1,101 +0,0 @@
|
|||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import json
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
|
||||||
from ..utils import int_or_none
|
|
||||||
|
|
||||||
|
|
||||||
class CollegeHumorIE(InfoExtractor):
|
|
||||||
_VALID_URL = r'^(?:https?://)?(?:www\.)?collegehumor\.com/(video|embed|e)/(?P<videoid>[0-9]+)/?(?P<shorttitle>.*)$'
|
|
||||||
|
|
||||||
_TESTS = [
|
|
||||||
{
|
|
||||||
'url': 'http://www.collegehumor.com/video/6902724/comic-con-cosplay-catastrophe',
|
|
||||||
'md5': 'dcc0f5c1c8be98dc33889a191f4c26bd',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '6902724',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'Comic-Con Cosplay Catastrophe',
|
|
||||||
'description': "Fans get creative this year at San Diego. Too creative. And yes, that's really Joss Whedon.",
|
|
||||||
'age_limit': 13,
|
|
||||||
'duration': 187,
|
|
||||||
},
|
|
||||||
}, {
|
|
||||||
'url': 'http://www.collegehumor.com/video/3505939/font-conference',
|
|
||||||
'md5': '72fa701d8ef38664a4dbb9e2ab721816',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '3505939',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'Font Conference',
|
|
||||||
'description': "This video wasn't long enough, so we made it double-spaced.",
|
|
||||||
'age_limit': 10,
|
|
||||||
'duration': 179,
|
|
||||||
},
|
|
||||||
}, {
|
|
||||||
# embedded youtube video
|
|
||||||
'url': 'http://www.collegehumor.com/embed/6950306',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'Z-bao9fg6Yc',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'Young Americans Think President John F. Kennedy Died THIS MORNING IN A CAR ACCIDENT!!!',
|
|
||||||
'uploader': 'Mark Dice',
|
|
||||||
'uploader_id': 'MarkDice',
|
|
||||||
'description': 'md5:62c3dab9351fac7bb44b53b69511d87f',
|
|
||||||
'upload_date': '20140127',
|
|
||||||
},
|
|
||||||
'params': {
|
|
||||||
'skip_download': True,
|
|
||||||
},
|
|
||||||
'add_ie': ['Youtube'],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
mobj = re.match(self._VALID_URL, url)
|
|
||||||
video_id = mobj.group('videoid')
|
|
||||||
|
|
||||||
jsonUrl = 'http://www.collegehumor.com/moogaloop/video/' + video_id + '.json'
|
|
||||||
data = json.loads(self._download_webpage(
|
|
||||||
jsonUrl, video_id, 'Downloading info JSON'))
|
|
||||||
vdata = data['video']
|
|
||||||
if vdata.get('youtubeId') is not None:
|
|
||||||
return {
|
|
||||||
'_type': 'url',
|
|
||||||
'url': vdata['youtubeId'],
|
|
||||||
'ie_key': 'Youtube',
|
|
||||||
}
|
|
||||||
|
|
||||||
AGE_LIMITS = {'nc17': 18, 'r': 18, 'pg13': 13, 'pg': 10, 'g': 0}
|
|
||||||
rating = vdata.get('rating')
|
|
||||||
if rating:
|
|
||||||
age_limit = AGE_LIMITS.get(rating.lower())
|
|
||||||
else:
|
|
||||||
age_limit = None # None = No idea
|
|
||||||
|
|
||||||
PREFS = {'high_quality': 2, 'low_quality': 0}
|
|
||||||
formats = []
|
|
||||||
for format_key in ('mp4', 'webm'):
|
|
||||||
for qname, qurl in vdata.get(format_key, {}).items():
|
|
||||||
formats.append({
|
|
||||||
'format_id': format_key + '_' + qname,
|
|
||||||
'url': qurl,
|
|
||||||
'format': format_key,
|
|
||||||
'preference': PREFS.get(qname),
|
|
||||||
})
|
|
||||||
self._sort_formats(formats)
|
|
||||||
|
|
||||||
duration = int_or_none(vdata.get('duration'), 1000)
|
|
||||||
like_count = int_or_none(vdata.get('likes'))
|
|
||||||
|
|
||||||
return {
|
|
||||||
'id': video_id,
|
|
||||||
'title': vdata['title'],
|
|
||||||
'description': vdata.get('description'),
|
|
||||||
'thumbnail': vdata.get('thumbnail'),
|
|
||||||
'formats': formats,
|
|
||||||
'age_limit': age_limit,
|
|
||||||
'duration': duration,
|
|
||||||
'like_count': like_count,
|
|
||||||
}
|
|
||||||
@@ -44,10 +44,10 @@ class ComedyCentralShowsIE(MTVServicesInfoExtractor):
|
|||||||
# or: http://www.colbertnation.com/the-colbert-report-collections/422008/festival-of-lights/79524
|
# or: http://www.colbertnation.com/the-colbert-report-collections/422008/festival-of-lights/79524
|
||||||
_VALID_URL = r'''(?x)^(:(?P<shortname>tds|thedailyshow)
|
_VALID_URL = r'''(?x)^(:(?P<shortname>tds|thedailyshow)
|
||||||
|https?://(:www\.)?
|
|https?://(:www\.)?
|
||||||
(?P<showname>thedailyshow|thecolbertreport)\.(?:cc\.)?com/
|
(?P<showname>thedailyshow|thecolbertreport|tosh)\.(?:cc\.)?com/
|
||||||
((?:full-)?episodes/(?:[0-9a-z]{6}/)?(?P<episode>.*)|
|
((?:full-)?episodes/(?:[0-9a-z]{6}/)?(?P<episode>.*)|
|
||||||
(?P<clip>
|
(?P<clip>
|
||||||
(?:(?:guests/[^/]+|videos|video-playlists|special-editions|news-team/[^/]+)/[^/]+/(?P<videotitle>[^/?#]+))
|
(?:(?:guests/[^/]+|videos|video-(?:clips|playlists)|special-editions|news-team/[^/]+)/[^/]+/(?P<videotitle>[^/?#]+))
|
||||||
|(the-colbert-report-(videos|collections)/(?P<clipID>[0-9]+)/[^/]*/(?P<cntitle>.*?))
|
|(the-colbert-report-(videos|collections)/(?P<clipID>[0-9]+)/[^/]*/(?P<cntitle>.*?))
|
||||||
|(watch/(?P<date>[^/]*)/(?P<tdstitle>.*))
|
|(watch/(?P<date>[^/]*)/(?P<tdstitle>.*))
|
||||||
)|
|
)|
|
||||||
@@ -129,6 +129,9 @@ class ComedyCentralShowsIE(MTVServicesInfoExtractor):
|
|||||||
}, {
|
}, {
|
||||||
'url': 'http://thedailyshow.cc.com/news-team/michael-che/7wnfel/we-need-to-talk-about-israel',
|
'url': 'http://thedailyshow.cc.com/news-team/michael-che/7wnfel/we-need-to-talk-about-israel',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'http://tosh.cc.com/video-clips/68g93d/twitter-users-share-summer-plans',
|
||||||
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
_available_formats = ['3500', '2200', '1700', '1200', '750', '400']
|
_available_formats = ['3500', '2200', '1700', '1200', '750', '400']
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ from ..utils import (
|
|||||||
unescapeHTML,
|
unescapeHTML,
|
||||||
unified_strdate,
|
unified_strdate,
|
||||||
url_basename,
|
url_basename,
|
||||||
|
xpath_element,
|
||||||
xpath_text,
|
xpath_text,
|
||||||
xpath_with_ns,
|
xpath_with_ns,
|
||||||
determine_protocol,
|
determine_protocol,
|
||||||
@@ -52,6 +53,7 @@ from ..utils import (
|
|||||||
mimetype2ext,
|
mimetype2ext,
|
||||||
update_Request,
|
update_Request,
|
||||||
update_url_query,
|
update_url_query,
|
||||||
|
parse_m3u8_attributes,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -163,7 +165,7 @@ class InfoExtractor(object):
|
|||||||
description: Full video description.
|
description: Full video description.
|
||||||
uploader: Full name of the video uploader.
|
uploader: Full name of the video uploader.
|
||||||
license: License name the video is licensed under.
|
license: License name the video is licensed under.
|
||||||
creator: The main artist who created the video.
|
creator: The creator of the video.
|
||||||
release_date: The date (YYYYMMDD) when the video was released.
|
release_date: The date (YYYYMMDD) when the video was released.
|
||||||
timestamp: UNIX timestamp of the moment the video became available.
|
timestamp: UNIX timestamp of the moment the video became available.
|
||||||
upload_date: Video upload date (YYYYMMDD).
|
upload_date: Video upload date (YYYYMMDD).
|
||||||
@@ -232,6 +234,24 @@ class InfoExtractor(object):
|
|||||||
episode_number: Number of the video episode within a season, as an integer.
|
episode_number: Number of the video episode within a season, as an integer.
|
||||||
episode_id: Id of the video episode, as a unicode string.
|
episode_id: Id of the video episode, as a unicode string.
|
||||||
|
|
||||||
|
The following fields should only be used when the media is a track or a part of
|
||||||
|
a music album:
|
||||||
|
|
||||||
|
track: Title of the track.
|
||||||
|
track_number: Number of the track within an album or a disc, as an integer.
|
||||||
|
track_id: Id of the track (useful in case of custom indexing, e.g. 6.iii),
|
||||||
|
as a unicode string.
|
||||||
|
artist: Artist(s) of the track.
|
||||||
|
genre: Genre(s) of the track.
|
||||||
|
album: Title of the album the track belongs to.
|
||||||
|
album_type: Type of the album (e.g. "Demo", "Full-length", "Split", "Compilation", etc).
|
||||||
|
album_artist: List of all artists appeared on the album (e.g.
|
||||||
|
"Ash Borer / Fell Voices" or "Various Artists", useful for splits
|
||||||
|
and compilations).
|
||||||
|
disc_number: Number of the disc or other physical medium the track belongs to,
|
||||||
|
as an integer.
|
||||||
|
release_year: Year (YYYY) when the album was released.
|
||||||
|
|
||||||
Unless mentioned otherwise, the fields should be Unicode strings.
|
Unless mentioned otherwise, the fields should be Unicode strings.
|
||||||
|
|
||||||
Unless mentioned otherwise, None is equivalent to absence of information.
|
Unless mentioned otherwise, None is equivalent to absence of information.
|
||||||
@@ -358,14 +378,13 @@ class InfoExtractor(object):
|
|||||||
self.to_screen('%s' % (note,))
|
self.to_screen('%s' % (note,))
|
||||||
else:
|
else:
|
||||||
self.to_screen('%s: %s' % (video_id, note))
|
self.to_screen('%s: %s' % (video_id, note))
|
||||||
# data, headers and query params will be ignored for `Request` objects
|
|
||||||
if isinstance(url_or_request, compat_urllib_request.Request):
|
if isinstance(url_or_request, compat_urllib_request.Request):
|
||||||
url_or_request = update_Request(
|
url_or_request = update_Request(
|
||||||
url_or_request, data=data, headers=headers, query=query)
|
url_or_request, data=data, headers=headers, query=query)
|
||||||
else:
|
else:
|
||||||
if query:
|
if query:
|
||||||
url_or_request = update_url_query(url_or_request, query)
|
url_or_request = update_url_query(url_or_request, query)
|
||||||
if data or headers:
|
if data is not None or headers:
|
||||||
url_or_request = sanitized_Request(url_or_request, data, headers)
|
url_or_request = sanitized_Request(url_or_request, data, headers)
|
||||||
try:
|
try:
|
||||||
return self._downloader.urlopen(url_or_request)
|
return self._downloader.urlopen(url_or_request)
|
||||||
@@ -730,10 +749,12 @@ class InfoExtractor(object):
|
|||||||
return self._og_search_property('url', html, **kargs)
|
return self._og_search_property('url', html, **kargs)
|
||||||
|
|
||||||
def _html_search_meta(self, name, html, display_name=None, fatal=False, **kwargs):
|
def _html_search_meta(self, name, html, display_name=None, fatal=False, **kwargs):
|
||||||
|
if not isinstance(name, (list, tuple)):
|
||||||
|
name = [name]
|
||||||
if display_name is None:
|
if display_name is None:
|
||||||
display_name = name
|
display_name = name[0]
|
||||||
return self._html_search_regex(
|
return self._html_search_regex(
|
||||||
self._meta_regex(name),
|
[self._meta_regex(n) for n in name],
|
||||||
html, display_name, fatal=fatal, group='content', **kwargs)
|
html, display_name, fatal=fatal, group='content', **kwargs)
|
||||||
|
|
||||||
def _dc_search_uploader(self, html):
|
def _dc_search_uploader(self, html):
|
||||||
@@ -825,7 +846,7 @@ class InfoExtractor(object):
|
|||||||
for input in re.findall(r'(?i)<input([^>]+)>', html):
|
for input in re.findall(r'(?i)<input([^>]+)>', html):
|
||||||
if not re.search(r'type=(["\'])(?:hidden|submit)\1', input):
|
if not re.search(r'type=(["\'])(?:hidden|submit)\1', input):
|
||||||
continue
|
continue
|
||||||
name = re.search(r'name=(["\'])(?P<value>.+?)\1', input)
|
name = re.search(r'(?:name|id)=(["\'])(?P<value>.+?)\1', input)
|
||||||
if not name:
|
if not name:
|
||||||
continue
|
continue
|
||||||
value = re.search(r'value=(["\'])(?P<value>.*?)\1', input)
|
value = re.search(r'value=(["\'])(?P<value>.*?)\1', input)
|
||||||
@@ -857,7 +878,11 @@ class InfoExtractor(object):
|
|||||||
f['ext'] = determine_ext(f['url'])
|
f['ext'] = determine_ext(f['url'])
|
||||||
|
|
||||||
if isinstance(field_preference, (list, tuple)):
|
if isinstance(field_preference, (list, tuple)):
|
||||||
return tuple(f.get(field) if f.get(field) is not None else -1 for field in field_preference)
|
return tuple(
|
||||||
|
f.get(field)
|
||||||
|
if f.get(field) is not None
|
||||||
|
else ('' if field == 'format_id' else -1)
|
||||||
|
for field in field_preference)
|
||||||
|
|
||||||
preference = f.get('preference')
|
preference = f.get('preference')
|
||||||
if preference is None:
|
if preference is None:
|
||||||
@@ -970,7 +995,7 @@ class InfoExtractor(object):
|
|||||||
|
|
||||||
def _extract_f4m_formats(self, manifest_url, video_id, preference=None, f4m_id=None,
|
def _extract_f4m_formats(self, manifest_url, video_id, preference=None, f4m_id=None,
|
||||||
transform_source=lambda s: fix_xml_ampersands(s).strip(),
|
transform_source=lambda s: fix_xml_ampersands(s).strip(),
|
||||||
fatal=True):
|
fatal=True, m3u8_id=None):
|
||||||
manifest = self._download_xml(
|
manifest = self._download_xml(
|
||||||
manifest_url, video_id, 'Downloading f4m manifest',
|
manifest_url, video_id, 'Downloading f4m manifest',
|
||||||
'Unable to download f4m manifest',
|
'Unable to download f4m manifest',
|
||||||
@@ -984,11 +1009,18 @@ class InfoExtractor(object):
|
|||||||
|
|
||||||
return self._parse_f4m_formats(
|
return self._parse_f4m_formats(
|
||||||
manifest, manifest_url, video_id, preference=preference, f4m_id=f4m_id,
|
manifest, manifest_url, video_id, preference=preference, f4m_id=f4m_id,
|
||||||
transform_source=transform_source, fatal=fatal)
|
transform_source=transform_source, fatal=fatal, m3u8_id=m3u8_id)
|
||||||
|
|
||||||
def _parse_f4m_formats(self, manifest, manifest_url, video_id, preference=None, f4m_id=None,
|
def _parse_f4m_formats(self, manifest, manifest_url, video_id, preference=None, f4m_id=None,
|
||||||
transform_source=lambda s: fix_xml_ampersands(s).strip(),
|
transform_source=lambda s: fix_xml_ampersands(s).strip(),
|
||||||
fatal=True):
|
fatal=True, m3u8_id=None):
|
||||||
|
# currently youtube-dl cannot decode the playerVerificationChallenge as Akamai uses Adobe Alchemy
|
||||||
|
akamai_pv = manifest.find('{http://ns.adobe.com/f4m/1.0}pv-2.0')
|
||||||
|
if akamai_pv is not None and ';' in akamai_pv.text:
|
||||||
|
playerVerificationChallenge = akamai_pv.text.split(';')[0]
|
||||||
|
if playerVerificationChallenge.strip() != '':
|
||||||
|
return []
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
manifest_version = '1.0'
|
manifest_version = '1.0'
|
||||||
media_nodes = manifest.findall('{http://ns.adobe.com/f4m/1.0}media')
|
media_nodes = manifest.findall('{http://ns.adobe.com/f4m/1.0}media')
|
||||||
@@ -1005,9 +1037,26 @@ class InfoExtractor(object):
|
|||||||
'base URL', default=None)
|
'base URL', default=None)
|
||||||
if base_url:
|
if base_url:
|
||||||
base_url = base_url.strip()
|
base_url = base_url.strip()
|
||||||
|
|
||||||
|
bootstrap_info = xpath_element(
|
||||||
|
manifest, ['{http://ns.adobe.com/f4m/1.0}bootstrapInfo', '{http://ns.adobe.com/f4m/2.0}bootstrapInfo'],
|
||||||
|
'bootstrap info', default=None)
|
||||||
|
|
||||||
for i, media_el in enumerate(media_nodes):
|
for i, media_el in enumerate(media_nodes):
|
||||||
if manifest_version == '2.0':
|
tbr = int_or_none(media_el.attrib.get('bitrate'))
|
||||||
media_url = media_el.attrib.get('href') or media_el.attrib.get('url')
|
width = int_or_none(media_el.attrib.get('width'))
|
||||||
|
height = int_or_none(media_el.attrib.get('height'))
|
||||||
|
format_id = '-'.join(filter(None, [f4m_id, compat_str(i if tbr is None else tbr)]))
|
||||||
|
# If <bootstrapInfo> is present, the specified f4m is a
|
||||||
|
# stream-level manifest, and only set-level manifests may refer to
|
||||||
|
# external resources. See section 11.4 and section 4 of F4M spec
|
||||||
|
if bootstrap_info is None:
|
||||||
|
media_url = None
|
||||||
|
# @href is introduced in 2.0, see section 11.6 of F4M spec
|
||||||
|
if manifest_version == '2.0':
|
||||||
|
media_url = media_el.attrib.get('href')
|
||||||
|
if media_url is None:
|
||||||
|
media_url = media_el.attrib.get('url')
|
||||||
if not media_url:
|
if not media_url:
|
||||||
continue
|
continue
|
||||||
manifest_url = (
|
manifest_url = (
|
||||||
@@ -1017,29 +1066,43 @@ class InfoExtractor(object):
|
|||||||
# since bitrates in parent manifest (this one) and media_url manifest
|
# since bitrates in parent manifest (this one) and media_url manifest
|
||||||
# may differ leading to inability to resolve the format by requested
|
# may differ leading to inability to resolve the format by requested
|
||||||
# bitrate in f4m downloader
|
# bitrate in f4m downloader
|
||||||
if determine_ext(manifest_url) == 'f4m':
|
ext = determine_ext(manifest_url)
|
||||||
formats.extend(self._extract_f4m_formats(
|
if ext == 'f4m':
|
||||||
|
f4m_formats = self._extract_f4m_formats(
|
||||||
manifest_url, video_id, preference=preference, f4m_id=f4m_id,
|
manifest_url, video_id, preference=preference, f4m_id=f4m_id,
|
||||||
transform_source=transform_source, fatal=fatal))
|
transform_source=transform_source, fatal=fatal)
|
||||||
|
# Sometimes stream-level manifest contains single media entry that
|
||||||
|
# does not contain any quality metadata (e.g. http://matchtv.ru/#live-player).
|
||||||
|
# At the same time parent's media entry in set-level manifest may
|
||||||
|
# contain it. We will copy it from parent in such cases.
|
||||||
|
if len(f4m_formats) == 1:
|
||||||
|
f = f4m_formats[0]
|
||||||
|
f.update({
|
||||||
|
'tbr': f.get('tbr') or tbr,
|
||||||
|
'width': f.get('width') or width,
|
||||||
|
'height': f.get('height') or height,
|
||||||
|
'format_id': f.get('format_id') if not tbr else format_id,
|
||||||
|
})
|
||||||
|
formats.extend(f4m_formats)
|
||||||
|
continue
|
||||||
|
elif ext == 'm3u8':
|
||||||
|
formats.extend(self._extract_m3u8_formats(
|
||||||
|
manifest_url, video_id, 'mp4', preference=preference,
|
||||||
|
m3u8_id=m3u8_id, fatal=fatal))
|
||||||
continue
|
continue
|
||||||
tbr = int_or_none(media_el.attrib.get('bitrate'))
|
|
||||||
formats.append({
|
formats.append({
|
||||||
'format_id': '-'.join(filter(None, [f4m_id, compat_str(i if tbr is None else tbr)])),
|
'format_id': format_id,
|
||||||
'url': manifest_url,
|
'url': manifest_url,
|
||||||
'ext': 'flv',
|
'ext': 'flv' if bootstrap_info is not None else None,
|
||||||
'tbr': tbr,
|
'tbr': tbr,
|
||||||
'width': int_or_none(media_el.attrib.get('width')),
|
'width': width,
|
||||||
'height': int_or_none(media_el.attrib.get('height')),
|
'height': height,
|
||||||
'preference': preference,
|
'preference': preference,
|
||||||
})
|
})
|
||||||
return formats
|
return formats
|
||||||
|
|
||||||
def _extract_m3u8_formats(self, m3u8_url, video_id, ext=None,
|
def _m3u8_meta_format(self, m3u8_url, ext=None, preference=None, m3u8_id=None):
|
||||||
entry_protocol='m3u8', preference=None,
|
return {
|
||||||
m3u8_id=None, note=None, errnote=None,
|
|
||||||
fatal=True):
|
|
||||||
|
|
||||||
formats = [{
|
|
||||||
'format_id': '-'.join(filter(None, [m3u8_id, 'meta'])),
|
'format_id': '-'.join(filter(None, [m3u8_id, 'meta'])),
|
||||||
'url': m3u8_url,
|
'url': m3u8_url,
|
||||||
'ext': ext,
|
'ext': ext,
|
||||||
@@ -1047,7 +1110,14 @@ class InfoExtractor(object):
|
|||||||
'preference': preference - 1 if preference else -1,
|
'preference': preference - 1 if preference else -1,
|
||||||
'resolution': 'multiple',
|
'resolution': 'multiple',
|
||||||
'format_note': 'Quality selection URL',
|
'format_note': 'Quality selection URL',
|
||||||
}]
|
}
|
||||||
|
|
||||||
|
def _extract_m3u8_formats(self, m3u8_url, video_id, ext=None,
|
||||||
|
entry_protocol='m3u8', preference=None,
|
||||||
|
m3u8_id=None, note=None, errnote=None,
|
||||||
|
fatal=True, live=False):
|
||||||
|
|
||||||
|
formats = [self._m3u8_meta_format(m3u8_url, ext, preference, m3u8_id)]
|
||||||
|
|
||||||
format_url = lambda u: (
|
format_url = lambda u: (
|
||||||
u
|
u
|
||||||
@@ -1087,23 +1157,11 @@ class InfoExtractor(object):
|
|||||||
}]
|
}]
|
||||||
last_info = None
|
last_info = None
|
||||||
last_media = None
|
last_media = None
|
||||||
kv_rex = re.compile(
|
|
||||||
r'(?P<key>[a-zA-Z_-]+)=(?P<val>"[^"]+"|[^",]+)(?:,|$)')
|
|
||||||
for line in m3u8_doc.splitlines():
|
for line in m3u8_doc.splitlines():
|
||||||
if line.startswith('#EXT-X-STREAM-INF:'):
|
if line.startswith('#EXT-X-STREAM-INF:'):
|
||||||
last_info = {}
|
last_info = parse_m3u8_attributes(line)
|
||||||
for m in kv_rex.finditer(line):
|
|
||||||
v = m.group('val')
|
|
||||||
if v.startswith('"'):
|
|
||||||
v = v[1:-1]
|
|
||||||
last_info[m.group('key')] = v
|
|
||||||
elif line.startswith('#EXT-X-MEDIA:'):
|
elif line.startswith('#EXT-X-MEDIA:'):
|
||||||
last_media = {}
|
last_media = parse_m3u8_attributes(line)
|
||||||
for m in kv_rex.finditer(line):
|
|
||||||
v = m.group('val')
|
|
||||||
if v.startswith('"'):
|
|
||||||
v = v[1:-1]
|
|
||||||
last_media[m.group('key')] = v
|
|
||||||
elif line.startswith('#') or not line.strip():
|
elif line.startswith('#') or not line.strip():
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
@@ -1114,8 +1172,15 @@ class InfoExtractor(object):
|
|||||||
format_id = []
|
format_id = []
|
||||||
if m3u8_id:
|
if m3u8_id:
|
||||||
format_id.append(m3u8_id)
|
format_id.append(m3u8_id)
|
||||||
last_media_name = last_media.get('NAME') if last_media and last_media.get('TYPE') != 'SUBTITLES' else None
|
last_media_name = last_media.get('NAME') if last_media and last_media.get('TYPE') not in ('SUBTITLES', 'CLOSED-CAPTIONS') else None
|
||||||
format_id.append(last_media_name if last_media_name else '%d' % (tbr if tbr else len(formats)))
|
# Despite specification does not mention NAME attribute for
|
||||||
|
# EXT-X-STREAM-INF it still sometimes may be present
|
||||||
|
stream_name = last_info.get('NAME') or last_media_name
|
||||||
|
# Bandwidth of live streams may differ over time thus making
|
||||||
|
# format_id unpredictable. So it's better to keep provided
|
||||||
|
# format_id intact.
|
||||||
|
if not live:
|
||||||
|
format_id.append(stream_name if stream_name else '%d' % (tbr if tbr else len(formats)))
|
||||||
f = {
|
f = {
|
||||||
'format_id': '-'.join(format_id),
|
'format_id': '-'.join(format_id),
|
||||||
'url': format_url(line.strip()),
|
'url': format_url(line.strip()),
|
||||||
@@ -1247,21 +1312,21 @@ class InfoExtractor(object):
|
|||||||
m3u8_count = 0
|
m3u8_count = 0
|
||||||
|
|
||||||
srcs = []
|
srcs = []
|
||||||
videos = smil.findall(self._xpath_ns('.//video', namespace))
|
media = smil.findall(self._xpath_ns('.//video', namespace)) + smil.findall(self._xpath_ns('.//audio', namespace))
|
||||||
for video in videos:
|
for medium in media:
|
||||||
src = video.get('src')
|
src = medium.get('src')
|
||||||
if not src or src in srcs:
|
if not src or src in srcs:
|
||||||
continue
|
continue
|
||||||
srcs.append(src)
|
srcs.append(src)
|
||||||
|
|
||||||
bitrate = float_or_none(video.get('system-bitrate') or video.get('systemBitrate'), 1000)
|
bitrate = float_or_none(medium.get('system-bitrate') or medium.get('systemBitrate'), 1000)
|
||||||
filesize = int_or_none(video.get('size') or video.get('fileSize'))
|
filesize = int_or_none(medium.get('size') or medium.get('fileSize'))
|
||||||
width = int_or_none(video.get('width'))
|
width = int_or_none(medium.get('width'))
|
||||||
height = int_or_none(video.get('height'))
|
height = int_or_none(medium.get('height'))
|
||||||
proto = video.get('proto')
|
proto = medium.get('proto')
|
||||||
ext = video.get('ext')
|
ext = medium.get('ext')
|
||||||
src_ext = determine_ext(src)
|
src_ext = determine_ext(src)
|
||||||
streamer = video.get('streamer') or base
|
streamer = medium.get('streamer') or base
|
||||||
|
|
||||||
if proto == 'rtmp' or streamer.startswith('rtmp'):
|
if proto == 'rtmp' or streamer.startswith('rtmp'):
|
||||||
rtmp_count += 1
|
rtmp_count += 1
|
||||||
@@ -1516,7 +1581,7 @@ class InfoExtractor(object):
|
|||||||
media_template = representation_ms_info['media_template']
|
media_template = representation_ms_info['media_template']
|
||||||
media_template = media_template.replace('$RepresentationID$', representation_id)
|
media_template = media_template.replace('$RepresentationID$', representation_id)
|
||||||
media_template = re.sub(r'\$(Number|Bandwidth)\$', r'%(\1)d', media_template)
|
media_template = re.sub(r'\$(Number|Bandwidth)\$', r'%(\1)d', media_template)
|
||||||
media_template = re.sub(r'\$(Number|Bandwidth)%(\d+)\$', r'%(\1)\2d', media_template)
|
media_template = re.sub(r'\$(Number|Bandwidth)%([^$]+)\$', r'%(\1)\2', media_template)
|
||||||
media_template.replace('$$', '$')
|
media_template.replace('$$', '$')
|
||||||
representation_ms_info['segment_urls'] = [
|
representation_ms_info['segment_urls'] = [
|
||||||
media_template % {
|
media_template % {
|
||||||
|
|||||||
143
youtube_dl/extractor/coub.py
Normal file
143
youtube_dl/extractor/coub.py
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
ExtractorError,
|
||||||
|
float_or_none,
|
||||||
|
int_or_none,
|
||||||
|
parse_iso8601,
|
||||||
|
qualities,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class CoubIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'(?:coub:|https?://(?:coub\.com/(?:view|embed|coubs)/|c-cdn\.coub\.com/fb-player\.swf\?.*\bcoub(?:ID|id)=))(?P<id>[\da-z]+)'
|
||||||
|
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://coub.com/view/5u5n1',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '5u5n1',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'The Matrix Moonwalk',
|
||||||
|
'thumbnail': 're:^https?://.*\.jpg$',
|
||||||
|
'duration': 4.6,
|
||||||
|
'timestamp': 1428527772,
|
||||||
|
'upload_date': '20150408',
|
||||||
|
'uploader': 'Артём Лоскутников',
|
||||||
|
'uploader_id': 'artyom.loskutnikov',
|
||||||
|
'view_count': int,
|
||||||
|
'like_count': int,
|
||||||
|
'repost_count': int,
|
||||||
|
'comment_count': int,
|
||||||
|
'age_limit': 0,
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'url': 'http://c-cdn.coub.com/fb-player.swf?bot_type=vk&coubID=7w5a4',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'coub:5u5n1',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
# longer video id
|
||||||
|
'url': 'http://coub.com/view/237d5l5h',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
coub = self._download_json(
|
||||||
|
'http://coub.com/api/v2/coubs/%s.json' % video_id, video_id)
|
||||||
|
|
||||||
|
if coub.get('error'):
|
||||||
|
raise ExtractorError(
|
||||||
|
'%s said: %s' % (self.IE_NAME, coub['error']), expected=True)
|
||||||
|
|
||||||
|
title = coub['title']
|
||||||
|
|
||||||
|
file_versions = coub['file_versions']
|
||||||
|
|
||||||
|
QUALITIES = ('low', 'med', 'high')
|
||||||
|
|
||||||
|
MOBILE = 'mobile'
|
||||||
|
IPHONE = 'iphone'
|
||||||
|
HTML5 = 'html5'
|
||||||
|
|
||||||
|
SOURCE_PREFERENCE = (MOBILE, IPHONE, HTML5)
|
||||||
|
|
||||||
|
quality_key = qualities(QUALITIES)
|
||||||
|
preference_key = qualities(SOURCE_PREFERENCE)
|
||||||
|
|
||||||
|
formats = []
|
||||||
|
|
||||||
|
for kind, items in file_versions.get(HTML5, {}).items():
|
||||||
|
if kind not in ('video', 'audio'):
|
||||||
|
continue
|
||||||
|
if not isinstance(items, dict):
|
||||||
|
continue
|
||||||
|
for quality, item in items.items():
|
||||||
|
if not isinstance(item, dict):
|
||||||
|
continue
|
||||||
|
item_url = item.get('url')
|
||||||
|
if not item_url:
|
||||||
|
continue
|
||||||
|
formats.append({
|
||||||
|
'url': item_url,
|
||||||
|
'format_id': '%s-%s-%s' % (HTML5, kind, quality),
|
||||||
|
'filesize': int_or_none(item.get('size')),
|
||||||
|
'vcodec': 'none' if kind == 'audio' else None,
|
||||||
|
'quality': quality_key(quality),
|
||||||
|
'preference': preference_key(HTML5),
|
||||||
|
})
|
||||||
|
|
||||||
|
iphone_url = file_versions.get(IPHONE, {}).get('url')
|
||||||
|
if iphone_url:
|
||||||
|
formats.append({
|
||||||
|
'url': iphone_url,
|
||||||
|
'format_id': IPHONE,
|
||||||
|
'preference': preference_key(IPHONE),
|
||||||
|
})
|
||||||
|
|
||||||
|
mobile_url = file_versions.get(MOBILE, {}).get('audio_url')
|
||||||
|
if mobile_url:
|
||||||
|
formats.append({
|
||||||
|
'url': mobile_url,
|
||||||
|
'format_id': '%s-audio' % MOBILE,
|
||||||
|
'preference': preference_key(MOBILE),
|
||||||
|
})
|
||||||
|
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
thumbnail = coub.get('picture')
|
||||||
|
duration = float_or_none(coub.get('duration'))
|
||||||
|
timestamp = parse_iso8601(coub.get('published_at') or coub.get('created_at'))
|
||||||
|
uploader = coub.get('channel', {}).get('title')
|
||||||
|
uploader_id = coub.get('channel', {}).get('permalink')
|
||||||
|
|
||||||
|
view_count = int_or_none(coub.get('views_count') or coub.get('views_increase_count'))
|
||||||
|
like_count = int_or_none(coub.get('likes_count'))
|
||||||
|
repost_count = int_or_none(coub.get('recoubs_count'))
|
||||||
|
comment_count = int_or_none(coub.get('comments_count'))
|
||||||
|
|
||||||
|
age_restricted = coub.get('age_restricted', coub.get('age_restricted_by_admin'))
|
||||||
|
if age_restricted is not None:
|
||||||
|
age_limit = 18 if age_restricted is True else 0
|
||||||
|
else:
|
||||||
|
age_limit = None
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': title,
|
||||||
|
'thumbnail': thumbnail,
|
||||||
|
'duration': duration,
|
||||||
|
'timestamp': timestamp,
|
||||||
|
'uploader': uploader,
|
||||||
|
'uploader_id': uploader_id,
|
||||||
|
'view_count': view_count,
|
||||||
|
'like_count': like_count,
|
||||||
|
'repost_count': repost_count,
|
||||||
|
'comment_count': comment_count,
|
||||||
|
'age_limit': age_limit,
|
||||||
|
'formats': formats,
|
||||||
|
}
|
||||||
@@ -11,7 +11,6 @@ from math import pow, sqrt, floor
|
|||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import (
|
from ..compat import (
|
||||||
compat_etree_fromstring,
|
compat_etree_fromstring,
|
||||||
compat_urllib_parse_unquote,
|
|
||||||
compat_urllib_parse_urlencode,
|
compat_urllib_parse_urlencode,
|
||||||
compat_urllib_request,
|
compat_urllib_request,
|
||||||
compat_urlparse,
|
compat_urlparse,
|
||||||
@@ -27,6 +26,7 @@ from ..utils import (
|
|||||||
unified_strdate,
|
unified_strdate,
|
||||||
urlencode_postdata,
|
urlencode_postdata,
|
||||||
xpath_text,
|
xpath_text,
|
||||||
|
extract_attributes,
|
||||||
)
|
)
|
||||||
from ..aes import (
|
from ..aes import (
|
||||||
aes_cbc_decrypt,
|
aes_cbc_decrypt,
|
||||||
@@ -306,28 +306,36 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
|
|||||||
r'<a[^>]+href="/publisher/[^"]+"[^>]*>([^<]+)</a>', webpage,
|
r'<a[^>]+href="/publisher/[^"]+"[^>]*>([^<]+)</a>', webpage,
|
||||||
'video_uploader', fatal=False)
|
'video_uploader', fatal=False)
|
||||||
|
|
||||||
playerdata_url = compat_urllib_parse_unquote(self._html_search_regex(r'"config_url":"([^"]+)', webpage, 'playerdata_url'))
|
available_fmts = []
|
||||||
playerdata_req = sanitized_Request(playerdata_url)
|
for a, fmt in re.findall(r'(<a[^>]+token=["\']showmedia\.([0-9]{3,4})p["\'][^>]+>)', webpage):
|
||||||
playerdata_req.data = urlencode_postdata({'current_page': webpage_url})
|
attrs = extract_attributes(a)
|
||||||
playerdata_req.add_header('Content-Type', 'application/x-www-form-urlencoded')
|
href = attrs.get('href')
|
||||||
playerdata = self._download_webpage(playerdata_req, video_id, note='Downloading media info')
|
if href and '/freetrial' in href:
|
||||||
|
continue
|
||||||
stream_id = self._search_regex(r'<media_id>([^<]+)', playerdata, 'stream_id')
|
available_fmts.append(fmt)
|
||||||
video_thumbnail = self._search_regex(r'<episode_image_url>([^<]+)', playerdata, 'thumbnail', fatal=False)
|
if not available_fmts:
|
||||||
|
for p in (r'token=["\']showmedia\.([0-9]{3,4})p"', r'showmedia\.([0-9]{3,4})p'):
|
||||||
|
available_fmts = re.findall(p, webpage)
|
||||||
|
if available_fmts:
|
||||||
|
break
|
||||||
|
video_encode_ids = []
|
||||||
formats = []
|
formats = []
|
||||||
for fmt in re.findall(r'showmedia\.([0-9]{3,4})p', webpage):
|
for fmt in available_fmts:
|
||||||
stream_quality, stream_format = self._FORMAT_IDS[fmt]
|
stream_quality, stream_format = self._FORMAT_IDS[fmt]
|
||||||
video_format = fmt + 'p'
|
video_format = fmt + 'p'
|
||||||
streamdata_req = sanitized_Request(
|
streamdata_req = sanitized_Request(
|
||||||
'http://www.crunchyroll.com/xml/?req=RpcApiVideoPlayer_GetStandardConfig&media_id=%s&video_format=%s&video_quality=%s'
|
'http://www.crunchyroll.com/xml/?req=RpcApiVideoPlayer_GetStandardConfig&media_id=%s&video_format=%s&video_quality=%s'
|
||||||
% (stream_id, stream_format, stream_quality),
|
% (video_id, stream_format, stream_quality),
|
||||||
compat_urllib_parse_urlencode({'current_page': url}).encode('utf-8'))
|
compat_urllib_parse_urlencode({'current_page': url}).encode('utf-8'))
|
||||||
streamdata_req.add_header('Content-Type', 'application/x-www-form-urlencoded')
|
streamdata_req.add_header('Content-Type', 'application/x-www-form-urlencoded')
|
||||||
streamdata = self._download_xml(
|
streamdata = self._download_xml(
|
||||||
streamdata_req, video_id,
|
streamdata_req, video_id,
|
||||||
note='Downloading media info for %s' % video_format)
|
note='Downloading media info for %s' % video_format)
|
||||||
stream_info = streamdata.find('./{default}preload/stream_info')
|
stream_info = streamdata.find('./{default}preload/stream_info')
|
||||||
|
video_encode_id = xpath_text(stream_info, './video_encode_id')
|
||||||
|
if video_encode_id in video_encode_ids:
|
||||||
|
continue
|
||||||
|
video_encode_ids.append(video_encode_id)
|
||||||
video_url = xpath_text(stream_info, './host')
|
video_url = xpath_text(stream_info, './host')
|
||||||
video_play_path = xpath_text(stream_info, './file')
|
video_play_path = xpath_text(stream_info, './file')
|
||||||
if not video_url or not video_play_path:
|
if not video_url or not video_play_path:
|
||||||
@@ -359,6 +367,14 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
|
|||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
})
|
})
|
||||||
formats.append(format_info)
|
formats.append(format_info)
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
metadata = self._download_xml(
|
||||||
|
'http://www.crunchyroll.com/xml', video_id,
|
||||||
|
note='Downloading media info', query={
|
||||||
|
'req': 'RpcApiVideoPlayer_GetMediaMetadata',
|
||||||
|
'media_id': video_id,
|
||||||
|
})
|
||||||
|
|
||||||
subtitles = self.extract_subtitles(video_id, webpage)
|
subtitles = self.extract_subtitles(video_id, webpage)
|
||||||
|
|
||||||
@@ -366,9 +382,12 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
|
|||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': video_title,
|
'title': video_title,
|
||||||
'description': video_description,
|
'description': video_description,
|
||||||
'thumbnail': video_thumbnail,
|
'thumbnail': xpath_text(metadata, 'episode_image_url'),
|
||||||
'uploader': video_uploader,
|
'uploader': video_uploader,
|
||||||
'upload_date': video_upload_date,
|
'upload_date': video_upload_date,
|
||||||
|
'series': xpath_text(metadata, 'series_title'),
|
||||||
|
'episode': xpath_text(metadata, 'episode_title'),
|
||||||
|
'episode_number': int_or_none(xpath_text(metadata, 'episode_number')),
|
||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
|||||||
30
youtube_dl/extractor/ctv.py
Normal file
30
youtube_dl/extractor/ctv.py
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
|
class CTVIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?ctv\.ca/video/player\?vid=(?P<id>[0-9.]+)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://www.ctv.ca/video/player?vid=706966',
|
||||||
|
'md5': 'ff2ebbeae0aa2dcc32a830c3fd69b7b0',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '706966',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Larry Day and Richard Jutras on the TIFF red carpet of \'Stonewall\'',
|
||||||
|
'description': 'etalk catches up with Larry Day and Richard Jutras on the TIFF red carpet of "Stonewall”.',
|
||||||
|
'upload_date': '20150919',
|
||||||
|
'timestamp': 1442624700,
|
||||||
|
},
|
||||||
|
'expected_warnings': ['HTTP Error 404'],
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
return {
|
||||||
|
'_type': 'url_transparent',
|
||||||
|
'id': video_id,
|
||||||
|
'url': '9c9media:ctv_web:%s' % video_id,
|
||||||
|
'ie_key': 'NineCNineMedia',
|
||||||
|
}
|
||||||
65
youtube_dl/extractor/ctvnews.py
Normal file
65
youtube_dl/extractor/ctvnews.py
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import orderedSet
|
||||||
|
|
||||||
|
|
||||||
|
class CTVNewsIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?ctvnews\.ca/(?:video\?(?:clip|playlist|bin)Id=|.*?)(?P<id>[0-9.]+)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://www.ctvnews.ca/video?clipId=901995',
|
||||||
|
'md5': '10deb320dc0ccb8d01d34d12fc2ea672',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '901995',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Extended: \'That person cannot be me\' Johnson says',
|
||||||
|
'description': 'md5:958dd3b4f5bbbf0ed4d045c790d89285',
|
||||||
|
'timestamp': 1467286284,
|
||||||
|
'upload_date': '20160630',
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.ctvnews.ca/video?playlistId=1.2966224',
|
||||||
|
'info_dict':
|
||||||
|
{
|
||||||
|
'id': '1.2966224',
|
||||||
|
},
|
||||||
|
'playlist_mincount': 19,
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.ctvnews.ca/video?binId=1.2876780',
|
||||||
|
'info_dict':
|
||||||
|
{
|
||||||
|
'id': '1.2876780',
|
||||||
|
},
|
||||||
|
'playlist_mincount': 100,
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.ctvnews.ca/1.810401',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.ctvnews.ca/canadiens-send-p-k-subban-to-nashville-in-blockbuster-trade-1.2967231',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
page_id = self._match_id(url)
|
||||||
|
|
||||||
|
def ninecninemedia_url_result(clip_id):
|
||||||
|
return {
|
||||||
|
'_type': 'url_transparent',
|
||||||
|
'id': clip_id,
|
||||||
|
'url': '9c9media:ctvnews_web:%s' % clip_id,
|
||||||
|
'ie_key': 'NineCNineMedia',
|
||||||
|
}
|
||||||
|
|
||||||
|
if page_id.isdigit():
|
||||||
|
return ninecninemedia_url_result(page_id)
|
||||||
|
else:
|
||||||
|
webpage = self._download_webpage('http://www.ctvnews.ca/%s' % page_id, page_id, query={
|
||||||
|
'ot': 'example.AjaxPageLayout.ot',
|
||||||
|
'maxItemsPerPage': 1000000,
|
||||||
|
})
|
||||||
|
entries = [ninecninemedia_url_result(clip_id) for clip_id in orderedSet(
|
||||||
|
re.findall(r'clip\.id\s*=\s*(\d+);', webpage))]
|
||||||
|
return self.playlist_result(entries, page_id)
|
||||||
@@ -9,7 +9,7 @@ from ..utils import (
|
|||||||
|
|
||||||
|
|
||||||
class CWTVIE(InfoExtractor):
|
class CWTVIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?cw(?:tv|seed)\.com/shows/(?:[^/]+/){2}\?play=(?P<id>[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})'
|
_VALID_URL = r'https?://(?:www\.)?cw(?:tv|seed)\.com/(?:shows/)?(?:[^/]+/){2}\?.*\bplay=(?P<id>[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://cwtv.com/shows/arrow/legends-of-yesterday/?play=6b15e985-9345-4f60-baf8-56e96be57c63',
|
'url': 'http://cwtv.com/shows/arrow/legends-of-yesterday/?play=6b15e985-9345-4f60-baf8-56e96be57c63',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
@@ -48,6 +48,9 @@ class CWTVIE(InfoExtractor):
|
|||||||
# m3u8 download
|
# m3u8 download
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
'url': 'http://cwtv.com/thecw/chroniclesofcisco/?play=8adebe35-f447-465f-ab52-e863506ff6d6',
|
||||||
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
|||||||
61
youtube_dl/extractor/dailymail.py
Normal file
61
youtube_dl/extractor/dailymail.py
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
int_or_none,
|
||||||
|
determine_protocol,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class DailyMailIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?dailymail\.co\.uk/video/[^/]+/video-(?P<id>[0-9]+)'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'http://www.dailymail.co.uk/video/sciencetech/video-1288527/Turn-video-impressionist-masterpiece.html',
|
||||||
|
'md5': '2f639d446394f53f3a33658b518b6615',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '1288527',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Turn any video into an impressionist masterpiece',
|
||||||
|
'description': 'md5:88ddbcb504367987b2708bb38677c9d2',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
video_data = self._parse_json(self._search_regex(
|
||||||
|
r"data-opts='({.+?})'", webpage, 'video data'), video_id)
|
||||||
|
title = video_data['title']
|
||||||
|
video_sources = self._download_json(video_data.get(
|
||||||
|
'sources', {}).get('url') or 'http://www.dailymail.co.uk/api/player/%s/video-sources.json' % video_id, video_id)
|
||||||
|
|
||||||
|
formats = []
|
||||||
|
for rendition in video_sources['renditions']:
|
||||||
|
rendition_url = rendition.get('url')
|
||||||
|
if not rendition_url:
|
||||||
|
continue
|
||||||
|
tbr = int_or_none(rendition.get('encodingRate'), 1000)
|
||||||
|
container = rendition.get('videoContainer')
|
||||||
|
is_hls = container == 'M2TS'
|
||||||
|
protocol = 'm3u8_native' if is_hls else determine_protocol({'url': rendition_url})
|
||||||
|
formats.append({
|
||||||
|
'format_id': ('hls' if is_hls else protocol) + ('-%d' % tbr if tbr else ''),
|
||||||
|
'url': rendition_url,
|
||||||
|
'width': int_or_none(rendition.get('frameWidth')),
|
||||||
|
'height': int_or_none(rendition.get('frameHeight')),
|
||||||
|
'tbr': tbr,
|
||||||
|
'vcodec': rendition.get('videoCodec'),
|
||||||
|
'container': container,
|
||||||
|
'protocol': protocol,
|
||||||
|
'ext': 'mp4' if is_hls else None,
|
||||||
|
})
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': title,
|
||||||
|
'description': video_data.get('descr'),
|
||||||
|
'thumbnail': video_data.get('poster') or video_data.get('thumbnail'),
|
||||||
|
'formats': formats,
|
||||||
|
}
|
||||||
@@ -20,7 +20,7 @@ from ..utils import (
|
|||||||
|
|
||||||
|
|
||||||
class DCNIE(InfoExtractor):
|
class DCNIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?dcndigital\.ae/(?:#/)?show/(?P<show_id>\d+)/[^/]+(?:/(?P<video_id>\d+)/(?P<season_id>\d+))?'
|
_VALID_URL = r'https?://(?:www\.)?(?:awaan|dcndigital)\.ae/(?:#/)?show/(?P<show_id>\d+)/[^/]+(?:/(?P<video_id>\d+)/(?P<season_id>\d+))?'
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
show_id, video_id, season_id = re.match(self._VALID_URL, url).groups()
|
show_id, video_id, season_id = re.match(self._VALID_URL, url).groups()
|
||||||
@@ -55,30 +55,32 @@ class DCNBaseIE(InfoExtractor):
|
|||||||
'is_live': is_live,
|
'is_live': is_live,
|
||||||
}
|
}
|
||||||
|
|
||||||
def _extract_video_formats(self, webpage, video_id, entry_protocol):
|
def _extract_video_formats(self, webpage, video_id, m3u8_entry_protocol):
|
||||||
formats = []
|
formats = []
|
||||||
m3u8_url = self._html_search_regex(
|
format_url_base = 'http' + self._html_search_regex(
|
||||||
r'file\s*:\s*"([^"]+)', webpage, 'm3u8 url', fatal=False)
|
[
|
||||||
if m3u8_url:
|
r'file\s*:\s*"https?(://[^"]+)/playlist.m3u8',
|
||||||
formats.extend(self._extract_m3u8_formats(
|
r'<a[^>]+href="rtsp(://[^"]+)"'
|
||||||
m3u8_url, video_id, 'mp4', entry_protocol, m3u8_id='hls', fatal=None))
|
], webpage, 'format url')
|
||||||
|
# TODO: Current DASH formats are broken - $Time$ pattern in
|
||||||
rtsp_url = self._search_regex(
|
# <SegmentTemplate> not implemented yet
|
||||||
r'<a[^>]+href="(rtsp://[^"]+)"', webpage, 'rtsp url', fatal=False)
|
# formats.extend(self._extract_mpd_formats(
|
||||||
if rtsp_url:
|
# format_url_base + '/manifest.mpd',
|
||||||
formats.append({
|
# video_id, mpd_id='dash', fatal=False))
|
||||||
'url': rtsp_url,
|
formats.extend(self._extract_m3u8_formats(
|
||||||
'format_id': 'rtsp',
|
format_url_base + '/playlist.m3u8', video_id, 'mp4',
|
||||||
})
|
m3u8_entry_protocol, m3u8_id='hls', fatal=False))
|
||||||
|
formats.extend(self._extract_f4m_formats(
|
||||||
|
format_url_base + '/manifest.f4m',
|
||||||
|
video_id, f4m_id='hds', fatal=False))
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
return formats
|
return formats
|
||||||
|
|
||||||
|
|
||||||
class DCNVideoIE(DCNBaseIE):
|
class DCNVideoIE(DCNBaseIE):
|
||||||
IE_NAME = 'dcn:video'
|
IE_NAME = 'dcn:video'
|
||||||
_VALID_URL = r'https?://(?:www\.)?dcndigital\.ae/(?:#/)?(?:video/[^/]+|media|catchup/[^/]+/[^/]+)/(?P<id>\d+)'
|
_VALID_URL = r'https?://(?:www\.)?(?:awaan|dcndigital)\.ae/(?:#/)?(?:video(?:/[^/]+)?|media|catchup/[^/]+/[^/]+)/(?P<id>\d+)'
|
||||||
_TEST = {
|
_TESTS = [{
|
||||||
'url': 'http://www.dcndigital.ae/#/video/%D8%B1%D8%AD%D9%84%D8%A9-%D8%A7%D9%84%D8%B9%D9%85%D8%B1-%D8%A7%D9%84%D8%AD%D9%84%D9%82%D8%A9-1/17375',
|
'url': 'http://www.dcndigital.ae/#/video/%D8%B1%D8%AD%D9%84%D8%A9-%D8%A7%D9%84%D8%B9%D9%85%D8%B1-%D8%A7%D9%84%D8%AD%D9%84%D9%82%D8%A9-1/17375',
|
||||||
'info_dict':
|
'info_dict':
|
||||||
{
|
{
|
||||||
@@ -94,7 +96,10 @@ class DCNVideoIE(DCNBaseIE):
|
|||||||
# m3u8 download
|
# m3u8 download
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
}
|
}, {
|
||||||
|
'url': 'http://awaan.ae/video/26723981/%D8%AF%D8%A7%D8%B1-%D8%A7%D9%84%D8%B3%D9%84%D8%A7%D9%85:-%D8%AE%D9%8A%D8%B1-%D8%AF%D9%88%D8%B1-%D8%A7%D9%84%D8%A3%D9%86%D8%B5%D8%A7%D8%B1',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
@@ -120,7 +125,7 @@ class DCNVideoIE(DCNBaseIE):
|
|||||||
|
|
||||||
class DCNLiveIE(DCNBaseIE):
|
class DCNLiveIE(DCNBaseIE):
|
||||||
IE_NAME = 'dcn:live'
|
IE_NAME = 'dcn:live'
|
||||||
_VALID_URL = r'https?://(?:www\.)?dcndigital\.ae/(?:#/)?live/(?P<id>\d+)'
|
_VALID_URL = r'https?://(?:www\.)?(?:awaan|dcndigital)\.ae/(?:#/)?live/(?P<id>\d+)'
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
channel_id = self._match_id(url)
|
channel_id = self._match_id(url)
|
||||||
@@ -147,7 +152,7 @@ class DCNLiveIE(DCNBaseIE):
|
|||||||
|
|
||||||
class DCNSeasonIE(InfoExtractor):
|
class DCNSeasonIE(InfoExtractor):
|
||||||
IE_NAME = 'dcn:season'
|
IE_NAME = 'dcn:season'
|
||||||
_VALID_URL = r'https?://(?:www\.)?dcndigital\.ae/(?:#/)?program/(?:(?P<show_id>\d+)|season/(?P<season_id>\d+))'
|
_VALID_URL = r'https?://(?:www\.)?(?:awaan|dcndigital)\.ae/(?:#/)?program/(?:(?P<show_id>\d+)|season/(?P<season_id>\d+))'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://dcndigital.ae/#/program/205024/%D9%85%D8%AD%D8%A7%D8%B6%D8%B1%D8%A7%D8%AA-%D8%A7%D9%84%D8%B4%D9%8A%D8%AE-%D8%A7%D9%84%D8%B4%D8%B9%D8%B1%D8%A7%D9%88%D9%8A',
|
'url': 'http://dcndigital.ae/#/program/205024/%D9%85%D8%AD%D8%A7%D8%B6%D8%B1%D8%A7%D8%AA-%D8%A7%D9%84%D8%B4%D9%8A%D8%AE-%D8%A7%D9%84%D8%B4%D8%B9%D8%B1%D8%A7%D9%88%D9%8A',
|
||||||
'info_dict':
|
'info_dict':
|
||||||
|
|||||||
@@ -17,37 +17,53 @@ class DemocracynowIE(InfoExtractor):
|
|||||||
IE_NAME = 'democracynow'
|
IE_NAME = 'democracynow'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://www.democracynow.org/shows/2015/7/3',
|
'url': 'http://www.democracynow.org/shows/2015/7/3',
|
||||||
'md5': 'fbb8fe3d7a56a5e12431ce2f9b2fab0d',
|
'md5': '3757c182d3d84da68f5c8f506c18c196',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '2015-0703-001',
|
'id': '2015-0703-001',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'July 03, 2015 - Democracy Now!',
|
'title': 'Daily Show',
|
||||||
'description': 'A daily independent global news hour with Amy Goodman & Juan González "What to the Slave is 4th of July?": James Earl Jones Reads Frederick Douglass\u2019 Historic Speech : "This Flag Comes Down Today": Bree Newsome Scales SC Capitol Flagpole, Takes Down Confederate Flag : "We Shall Overcome": Remembering Folk Icon, Activist Pete Seeger in His Own Words & Songs',
|
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.democracynow.org/2015/7/3/this_flag_comes_down_today_bree',
|
'url': 'http://www.democracynow.org/2015/7/3/this_flag_comes_down_today_bree',
|
||||||
'md5': 'fbb8fe3d7a56a5e12431ce2f9b2fab0d',
|
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '2015-0703-001',
|
'id': '2015-0703-001',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': '"This Flag Comes Down Today": Bree Newsome Scales SC Capitol Flagpole, Takes Down Confederate Flag',
|
'title': '"This Flag Comes Down Today": Bree Newsome Scales SC Capitol Flagpole, Takes Down Confederate Flag',
|
||||||
'description': 'md5:4d2bc4f0d29f5553c2210a4bc7761a21',
|
'description': 'md5:4d2bc4f0d29f5553c2210a4bc7761a21',
|
||||||
},
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
display_id = self._match_id(url)
|
display_id = self._match_id(url)
|
||||||
|
|
||||||
webpage = self._download_webpage(url, display_id)
|
webpage = self._download_webpage(url, display_id)
|
||||||
description = self._og_search_description(webpage)
|
|
||||||
|
|
||||||
json_data = self._parse_json(self._search_regex(
|
json_data = self._parse_json(self._search_regex(
|
||||||
r'<script[^>]+type="text/json"[^>]*>\s*({[^>]+})', webpage, 'json'),
|
r'<script[^>]+type="text/json"[^>]*>\s*({[^>]+})', webpage, 'json'),
|
||||||
display_id)
|
display_id)
|
||||||
video_id = None
|
|
||||||
|
title = json_data['title']
|
||||||
formats = []
|
formats = []
|
||||||
|
|
||||||
default_lang = 'en'
|
video_id = None
|
||||||
|
|
||||||
|
for key in ('file', 'audio', 'video', 'high_res_video'):
|
||||||
|
media_url = json_data.get(key, '')
|
||||||
|
if not media_url:
|
||||||
|
continue
|
||||||
|
media_url = re.sub(r'\?.*', '', compat_urlparse.urljoin(url, media_url))
|
||||||
|
video_id = video_id or remove_start(os.path.splitext(url_basename(media_url))[0], 'dn')
|
||||||
|
formats.append({
|
||||||
|
'url': media_url,
|
||||||
|
'vcodec': 'none' if key == 'audio' else None,
|
||||||
|
})
|
||||||
|
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
default_lang = 'en'
|
||||||
subtitles = {}
|
subtitles = {}
|
||||||
|
|
||||||
def add_subtitle_item(lang, info_dict):
|
def add_subtitle_item(lang, info_dict):
|
||||||
@@ -67,22 +83,13 @@ class DemocracynowIE(InfoExtractor):
|
|||||||
'url': compat_urlparse.urljoin(url, subtitle_item['url']),
|
'url': compat_urlparse.urljoin(url, subtitle_item['url']),
|
||||||
})
|
})
|
||||||
|
|
||||||
for key in ('file', 'audio', 'video'):
|
description = self._og_search_description(webpage, default=None)
|
||||||
media_url = json_data.get(key, '')
|
|
||||||
if not media_url:
|
|
||||||
continue
|
|
||||||
media_url = re.sub(r'\?.*', '', compat_urlparse.urljoin(url, media_url))
|
|
||||||
video_id = video_id or remove_start(os.path.splitext(url_basename(media_url))[0], 'dn')
|
|
||||||
formats.append({
|
|
||||||
'url': media_url,
|
|
||||||
})
|
|
||||||
|
|
||||||
self._sort_formats(formats)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id or display_id,
|
'id': video_id or display_id,
|
||||||
'title': json_data['title'],
|
'title': title,
|
||||||
'description': description,
|
'description': description,
|
||||||
|
'thumbnail': json_data.get('image'),
|
||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,39 +12,46 @@ class DFBIE(InfoExtractor):
|
|||||||
|
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://tv.dfb.de/video/u-19-em-stimmen-zum-spiel-gegen-russland/11633/',
|
'url': 'http://tv.dfb.de/video/u-19-em-stimmen-zum-spiel-gegen-russland/11633/',
|
||||||
# The md5 is different each time
|
'md5': 'ac0f98a52a330f700b4b3034ad240649',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '11633',
|
'id': '11633',
|
||||||
'display_id': 'u-19-em-stimmen-zum-spiel-gegen-russland',
|
'display_id': 'u-19-em-stimmen-zum-spiel-gegen-russland',
|
||||||
'ext': 'flv',
|
'ext': 'mp4',
|
||||||
'title': 'U 19-EM: Stimmen zum Spiel gegen Russland',
|
'title': 'U 19-EM: Stimmen zum Spiel gegen Russland',
|
||||||
'upload_date': '20150714',
|
'upload_date': '20150714',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
display_id, video_id = re.match(self._VALID_URL, url).groups()
|
||||||
video_id = mobj.group('id')
|
|
||||||
display_id = mobj.group('display_id')
|
|
||||||
|
|
||||||
webpage = self._download_webpage(url, display_id)
|
|
||||||
player_info = self._download_xml(
|
player_info = self._download_xml(
|
||||||
'http://tv.dfb.de/server/hd_video.php?play=%s' % video_id,
|
'http://tv.dfb.de/server/hd_video.php?play=%s' % video_id,
|
||||||
display_id)
|
display_id)
|
||||||
video_info = player_info.find('video')
|
video_info = player_info.find('video')
|
||||||
|
stream_access_url = self._proto_relative_url(video_info.find('url').text.strip())
|
||||||
|
|
||||||
f4m_info = self._download_xml(
|
formats = []
|
||||||
self._proto_relative_url(video_info.find('url').text.strip()), display_id)
|
# see http://tv.dfb.de/player/js/ajax.js for the method to extract m3u8 formats
|
||||||
token_el = f4m_info.find('token')
|
for sa_url in (stream_access_url, stream_access_url + '&area=&format=iphone'):
|
||||||
manifest_url = token_el.attrib['url'] + '?' + 'hdnea=' + token_el.attrib['auth'] + '&hdcore=3.2.0'
|
stream_access_info = self._download_xml(sa_url, display_id)
|
||||||
formats = self._extract_f4m_formats(manifest_url, display_id)
|
token_el = stream_access_info.find('token')
|
||||||
|
manifest_url = token_el.attrib['url'] + '?' + 'hdnea=' + token_el.attrib['auth']
|
||||||
|
if '.f4m' in manifest_url:
|
||||||
|
formats.extend(self._extract_f4m_formats(
|
||||||
|
manifest_url + '&hdcore=3.2.0',
|
||||||
|
display_id, f4m_id='hds', fatal=False))
|
||||||
|
else:
|
||||||
|
formats.extend(self._extract_m3u8_formats(
|
||||||
|
manifest_url, display_id, 'mp4',
|
||||||
|
'm3u8_native', m3u8_id='hls', fatal=False))
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'display_id': display_id,
|
'display_id': display_id,
|
||||||
'title': video_info.find('title').text,
|
'title': video_info.find('title').text,
|
||||||
'thumbnail': self._og_search_thumbnail(webpage),
|
'thumbnail': 'http://tv.dfb.de/images/%s_640x360.jpg' % video_id,
|
||||||
'upload_date': unified_strdate(video_info.find('time_date').text),
|
'upload_date': unified_strdate(video_info.find('time_date').text),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ class DiscoveryIE(InfoExtractor):
|
|||||||
'duration': 156,
|
'duration': 156,
|
||||||
'timestamp': 1302032462,
|
'timestamp': 1302032462,
|
||||||
'upload_date': '20110405',
|
'upload_date': '20110405',
|
||||||
|
'uploader_id': '103207',
|
||||||
},
|
},
|
||||||
'params': {
|
'params': {
|
||||||
'skip_download': True, # requires ffmpeg
|
'skip_download': True, # requires ffmpeg
|
||||||
@@ -54,7 +55,11 @@ class DiscoveryIE(InfoExtractor):
|
|||||||
'upload_date': '20140725',
|
'upload_date': '20140725',
|
||||||
'timestamp': 1406246400,
|
'timestamp': 1406246400,
|
||||||
'duration': 116,
|
'duration': 116,
|
||||||
|
'uploader_id': '103207',
|
||||||
},
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': True, # requires ffmpeg
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
@@ -66,13 +71,19 @@ class DiscoveryIE(InfoExtractor):
|
|||||||
entries = []
|
entries = []
|
||||||
|
|
||||||
for idx, video_info in enumerate(info['playlist']):
|
for idx, video_info in enumerate(info['playlist']):
|
||||||
formats = self._extract_m3u8_formats(
|
subtitles = {}
|
||||||
video_info['src'], display_id, 'mp4', 'm3u8_native', m3u8_id='hls',
|
caption_url = video_info.get('captionsUrl')
|
||||||
note='Download m3u8 information for video %d' % (idx + 1))
|
if caption_url:
|
||||||
self._sort_formats(formats)
|
subtitles = {
|
||||||
|
'en': [{
|
||||||
|
'url': caption_url,
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
entries.append({
|
entries.append({
|
||||||
|
'_type': 'url_transparent',
|
||||||
|
'url': 'http://players.brightcove.net/103207/default_default/index.html?videoId=ref:%s' % video_info['referenceId'],
|
||||||
'id': compat_str(video_info['id']),
|
'id': compat_str(video_info['id']),
|
||||||
'formats': formats,
|
|
||||||
'title': video_info['title'],
|
'title': video_info['title'],
|
||||||
'description': video_info.get('description'),
|
'description': video_info.get('description'),
|
||||||
'duration': parse_duration(video_info.get('video_length')),
|
'duration': parse_duration(video_info.get('video_length')),
|
||||||
@@ -80,6 +91,7 @@ class DiscoveryIE(InfoExtractor):
|
|||||||
'thumbnail': video_info.get('thumbnailURL'),
|
'thumbnail': video_info.get('thumbnailURL'),
|
||||||
'alt_title': video_info.get('secondary_title'),
|
'alt_title': video_info.get('secondary_title'),
|
||||||
'timestamp': parse_iso8601(video_info.get('publishedDate')),
|
'timestamp': parse_iso8601(video_info.get('publishedDate')),
|
||||||
|
'subtitles': subtitles,
|
||||||
})
|
})
|
||||||
|
|
||||||
return self.playlist_result(entries, display_id, video_title)
|
return self.playlist_result(entries, display_id, video_title)
|
||||||
|
|||||||
114
youtube_dl/extractor/dispeak.py
Normal file
114
youtube_dl/extractor/dispeak.py
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
int_or_none,
|
||||||
|
parse_duration,
|
||||||
|
remove_end,
|
||||||
|
xpath_element,
|
||||||
|
xpath_text,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class DigitallySpeakingIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:evt\.dispeak|events\.digitallyspeaking)\.com/(?:[^/]+/)+xml/(?P<id>[^.]+)\.xml'
|
||||||
|
|
||||||
|
_TESTS = [{
|
||||||
|
# From http://gdcvault.com/play/1023460/Tenacious-Design-and-The-Interface
|
||||||
|
'url': 'http://evt.dispeak.com/ubm/gdc/sf16/xml/840376_BQRC.xml',
|
||||||
|
'md5': 'a8efb6c31ed06ca8739294960b2dbabd',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '840376_BQRC',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Tenacious Design and The Interface of \'Destiny\'',
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
# From http://www.gdcvault.com/play/1014631/Classic-Game-Postmortem-PAC
|
||||||
|
'url': 'http://events.digitallyspeaking.com/gdc/sf11/xml/12396_1299111843500GMPX.xml',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _parse_mp4(self, metadata):
|
||||||
|
video_formats = []
|
||||||
|
video_root = None
|
||||||
|
|
||||||
|
mp4_video = xpath_text(metadata, './mp4video', default=None)
|
||||||
|
if mp4_video is not None:
|
||||||
|
mobj = re.match(r'(?P<root>https?://.*?/).*', mp4_video)
|
||||||
|
video_root = mobj.group('root')
|
||||||
|
if video_root is None:
|
||||||
|
http_host = xpath_text(metadata, 'httpHost', default=None)
|
||||||
|
if http_host:
|
||||||
|
video_root = 'http://%s/' % http_host
|
||||||
|
if video_root is None:
|
||||||
|
# Hard-coded in http://evt.dispeak.com/ubm/gdc/sf16/custom/player2.js
|
||||||
|
# Works for GPUTechConf, too
|
||||||
|
video_root = 'http://s3-2u.digitallyspeaking.com/'
|
||||||
|
|
||||||
|
formats = metadata.findall('./MBRVideos/MBRVideo')
|
||||||
|
if not formats:
|
||||||
|
return None
|
||||||
|
for a_format in formats:
|
||||||
|
stream_name = xpath_text(a_format, 'streamName', fatal=True)
|
||||||
|
video_path = re.match(r'mp4\:(?P<path>.*)', stream_name).group('path')
|
||||||
|
url = video_root + video_path
|
||||||
|
vbr = xpath_text(a_format, 'bitrate')
|
||||||
|
video_formats.append({
|
||||||
|
'url': url,
|
||||||
|
'vbr': int_or_none(vbr),
|
||||||
|
})
|
||||||
|
return video_formats
|
||||||
|
|
||||||
|
def _parse_flv(self, metadata):
|
||||||
|
formats = []
|
||||||
|
akamai_url = xpath_text(metadata, './akamaiHost', fatal=True)
|
||||||
|
audios = metadata.findall('./audios/audio')
|
||||||
|
for audio in audios:
|
||||||
|
formats.append({
|
||||||
|
'url': 'rtmp://%s/ondemand?ovpfv=1.1' % akamai_url,
|
||||||
|
'play_path': remove_end(audio.get('url'), '.flv'),
|
||||||
|
'ext': 'flv',
|
||||||
|
'vcodec': 'none',
|
||||||
|
'format_id': audio.get('code'),
|
||||||
|
})
|
||||||
|
slide_video_path = xpath_text(metadata, './slideVideo', fatal=True)
|
||||||
|
formats.append({
|
||||||
|
'url': 'rtmp://%s/ondemand?ovpfv=1.1' % akamai_url,
|
||||||
|
'play_path': remove_end(slide_video_path, '.flv'),
|
||||||
|
'ext': 'flv',
|
||||||
|
'format_note': 'slide deck video',
|
||||||
|
'quality': -2,
|
||||||
|
'preference': -2,
|
||||||
|
'format_id': 'slides',
|
||||||
|
})
|
||||||
|
speaker_video_path = xpath_text(metadata, './speakerVideo', fatal=True)
|
||||||
|
formats.append({
|
||||||
|
'url': 'rtmp://%s/ondemand?ovpfv=1.1' % akamai_url,
|
||||||
|
'play_path': remove_end(speaker_video_path, '.flv'),
|
||||||
|
'ext': 'flv',
|
||||||
|
'format_note': 'speaker video',
|
||||||
|
'quality': -1,
|
||||||
|
'preference': -1,
|
||||||
|
'format_id': 'speaker',
|
||||||
|
})
|
||||||
|
return formats
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
xml_description = self._download_xml(url, video_id)
|
||||||
|
metadata = xpath_element(xml_description, 'metadata')
|
||||||
|
|
||||||
|
video_formats = self._parse_mp4(metadata)
|
||||||
|
if video_formats is None:
|
||||||
|
video_formats = self._parse_flv(metadata)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'formats': video_formats,
|
||||||
|
'title': xpath_text(metadata, 'title', fatal=True),
|
||||||
|
'duration': parse_duration(xpath_text(metadata, 'endTime')),
|
||||||
|
'creator': xpath_text(metadata, 'speaker'),
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ class DouyuTVIE(InfoExtractor):
|
|||||||
'display_id': 'iseven',
|
'display_id': 'iseven',
|
||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
'title': 're:^清晨醒脑!T-ara根本停不下来! [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
|
'title': 're:^清晨醒脑!T-ara根本停不下来! [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
|
||||||
'description': 'md5:f34981259a03e980a3c6404190a3ed61',
|
'description': 're:.*m7show@163\.com.*',
|
||||||
'thumbnail': 're:^https?://.*\.jpg$',
|
'thumbnail': 're:^https?://.*\.jpg$',
|
||||||
'uploader': '7师傅',
|
'uploader': '7师傅',
|
||||||
'uploader_id': '431925',
|
'uploader_id': '431925',
|
||||||
@@ -43,7 +43,7 @@ class DouyuTVIE(InfoExtractor):
|
|||||||
'params': {
|
'params': {
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
'skip': 'Romm not found',
|
'skip': 'Room not found',
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.douyutv.com/17732',
|
'url': 'http://www.douyutv.com/17732',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
@@ -51,7 +51,7 @@ class DouyuTVIE(InfoExtractor):
|
|||||||
'display_id': '17732',
|
'display_id': '17732',
|
||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
'title': 're:^清晨醒脑!T-ara根本停不下来! [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
|
'title': 're:^清晨醒脑!T-ara根本停不下来! [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
|
||||||
'description': 'md5:f34981259a03e980a3c6404190a3ed61',
|
'description': 're:.*m7show@163\.com.*',
|
||||||
'thumbnail': 're:^https?://.*\.jpg$',
|
'thumbnail': 're:^https?://.*\.jpg$',
|
||||||
'uploader': '7师傅',
|
'uploader': '7师傅',
|
||||||
'uploader_id': '431925',
|
'uploader_id': '431925',
|
||||||
@@ -75,13 +75,28 @@ class DouyuTVIE(InfoExtractor):
|
|||||||
room_id = self._html_search_regex(
|
room_id = self._html_search_regex(
|
||||||
r'"room_id"\s*:\s*(\d+),', page, 'room id')
|
r'"room_id"\s*:\s*(\d+),', page, 'room id')
|
||||||
|
|
||||||
prefix = 'room/%s?aid=android&client_sys=android&time=%d' % (
|
config = None
|
||||||
room_id, int(time.time()))
|
# Douyu API sometimes returns error "Unable to load the requested class: eticket_redis_cache"
|
||||||
|
# Retry with different parameters - same parameters cause same errors
|
||||||
|
for i in range(5):
|
||||||
|
prefix = 'room/%s?aid=android&client_sys=android&time=%d' % (
|
||||||
|
room_id, int(time.time()))
|
||||||
|
auth = hashlib.md5((prefix + '1231').encode('ascii')).hexdigest()
|
||||||
|
|
||||||
auth = hashlib.md5((prefix + '1231').encode('ascii')).hexdigest()
|
config_page = self._download_webpage(
|
||||||
config = self._download_json(
|
'http://www.douyutv.com/api/v1/%s&auth=%s' % (prefix, auth),
|
||||||
'http://www.douyutv.com/api/v1/%s&auth=%s' % (prefix, auth),
|
video_id)
|
||||||
video_id)
|
try:
|
||||||
|
config = self._parse_json(config_page, video_id, fatal=False)
|
||||||
|
except ExtractorError:
|
||||||
|
# Wait some time before retrying to get a different time() value
|
||||||
|
self._sleep(1, video_id, msg_template='%(video_id)s: Error occurs. '
|
||||||
|
'Waiting for %(timeout)s seconds before retrying')
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
if config is None:
|
||||||
|
raise ExtractorError('Unable to fetch API result')
|
||||||
|
|
||||||
data = config['data']
|
data = config['data']
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,18 @@ import re
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import int_or_none
|
from ..compat import compat_urlparse
|
||||||
|
from ..utils import (
|
||||||
|
int_or_none,
|
||||||
|
update_url_query,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class DPlayIE(InfoExtractor):
|
class DPlayIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?P<domain>it\.dplay\.com|www\.dplay\.(?:dk|se|no))/[^/]+/(?P<id>[^/?#]+)'
|
_VALID_URL = r'https?://(?P<domain>it\.dplay\.com|www\.dplay\.(?:dk|se|no))/[^/]+/(?P<id>[^/?#]+)'
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
|
# geo restricted, via direct unsigned hls URL
|
||||||
'url': 'http://it.dplay.com/take-me-out/stagione-1-episodio-25/',
|
'url': 'http://it.dplay.com/take-me-out/stagione-1-episodio-25/',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '1255600',
|
'id': '1255600',
|
||||||
@@ -31,11 +36,12 @@ class DPlayIE(InfoExtractor):
|
|||||||
},
|
},
|
||||||
'expected_warnings': ['Unable to download f4m manifest'],
|
'expected_warnings': ['Unable to download f4m manifest'],
|
||||||
}, {
|
}, {
|
||||||
|
# non geo restricted, via secure api, unsigned download hls URL
|
||||||
'url': 'http://www.dplay.se/nugammalt-77-handelser-som-format-sverige/season-1-svensken-lar-sig-njuta-av-livet/',
|
'url': 'http://www.dplay.se/nugammalt-77-handelser-som-format-sverige/season-1-svensken-lar-sig-njuta-av-livet/',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '3172',
|
'id': '3172',
|
||||||
'display_id': 'season-1-svensken-lar-sig-njuta-av-livet',
|
'display_id': 'season-1-svensken-lar-sig-njuta-av-livet',
|
||||||
'ext': 'flv',
|
'ext': 'mp4',
|
||||||
'title': 'Svensken lär sig njuta av livet',
|
'title': 'Svensken lär sig njuta av livet',
|
||||||
'description': 'md5:d3819c9bccffd0fe458ca42451dd50d8',
|
'description': 'md5:d3819c9bccffd0fe458ca42451dd50d8',
|
||||||
'duration': 2650,
|
'duration': 2650,
|
||||||
@@ -48,23 +54,25 @@ class DPlayIE(InfoExtractor):
|
|||||||
'age_limit': 0,
|
'age_limit': 0,
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
|
# geo restricted, via secure api, unsigned download hls URL
|
||||||
'url': 'http://www.dplay.dk/mig-og-min-mor/season-6-episode-12/',
|
'url': 'http://www.dplay.dk/mig-og-min-mor/season-6-episode-12/',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '70816',
|
'id': '70816',
|
||||||
'display_id': 'season-6-episode-12',
|
'display_id': 'season-6-episode-12',
|
||||||
'ext': 'flv',
|
'ext': 'mp4',
|
||||||
'title': 'Episode 12',
|
'title': 'Episode 12',
|
||||||
'description': 'md5:9c86e51a93f8a4401fc9641ef9894c90',
|
'description': 'md5:9c86e51a93f8a4401fc9641ef9894c90',
|
||||||
'duration': 2563,
|
'duration': 2563,
|
||||||
'timestamp': 1429696800,
|
'timestamp': 1429696800,
|
||||||
'upload_date': '20150422',
|
'upload_date': '20150422',
|
||||||
'creator': 'Kanal 4',
|
'creator': 'Kanal 4 (Home)',
|
||||||
'series': 'Mig og min mor',
|
'series': 'Mig og min mor',
|
||||||
'season_number': 6,
|
'season_number': 6,
|
||||||
'episode_number': 12,
|
'episode_number': 12,
|
||||||
'age_limit': 0,
|
'age_limit': 0,
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
|
# geo restricted, via direct unsigned hls URL
|
||||||
'url': 'http://www.dplay.no/pga-tour/season-1-hoydepunkter-18-21-februar/',
|
'url': 'http://www.dplay.no/pga-tour/season-1-hoydepunkter-18-21-februar/',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
@@ -90,17 +98,24 @@ class DPlayIE(InfoExtractor):
|
|||||||
|
|
||||||
def extract_formats(protocol, manifest_url):
|
def extract_formats(protocol, manifest_url):
|
||||||
if protocol == 'hls':
|
if protocol == 'hls':
|
||||||
formats.extend(self._extract_m3u8_formats(
|
m3u8_formats = self._extract_m3u8_formats(
|
||||||
manifest_url, video_id, ext='mp4',
|
manifest_url, video_id, ext='mp4',
|
||||||
entry_protocol='m3u8_native', m3u8_id=protocol, fatal=False))
|
entry_protocol='m3u8_native', m3u8_id=protocol, fatal=False)
|
||||||
|
# Sometimes final URLs inside m3u8 are unsigned, let's fix this
|
||||||
|
# ourselves
|
||||||
|
query = compat_urlparse.parse_qs(compat_urlparse.urlparse(manifest_url).query)
|
||||||
|
for m3u8_format in m3u8_formats:
|
||||||
|
m3u8_format['url'] = update_url_query(m3u8_format['url'], query)
|
||||||
|
formats.extend(m3u8_formats)
|
||||||
elif protocol == 'hds':
|
elif protocol == 'hds':
|
||||||
formats.extend(self._extract_f4m_formats(
|
formats.extend(self._extract_f4m_formats(
|
||||||
manifest_url + '&hdcore=3.8.0&plugin=flowplayer-3.8.0.0',
|
manifest_url + '&hdcore=3.8.0&plugin=flowplayer-3.8.0.0',
|
||||||
video_id, f4m_id=protocol, fatal=False))
|
video_id, f4m_id=protocol, fatal=False))
|
||||||
|
|
||||||
domain_tld = domain.split('.')[-1]
|
domain_tld = domain.split('.')[-1]
|
||||||
if domain_tld in ('se', 'dk'):
|
if domain_tld in ('se', 'dk', 'no'):
|
||||||
for protocol in PROTOCOLS:
|
for protocol in PROTOCOLS:
|
||||||
|
# Providing dsc-geo allows to bypass geo restriction in some cases
|
||||||
self._set_cookie(
|
self._set_cookie(
|
||||||
'secure.dplay.%s' % domain_tld, 'dsc-geo',
|
'secure.dplay.%s' % domain_tld, 'dsc-geo',
|
||||||
json.dumps({
|
json.dumps({
|
||||||
@@ -113,13 +128,24 @@ class DPlayIE(InfoExtractor):
|
|||||||
'Downloading %s stream JSON' % protocol, fatal=False)
|
'Downloading %s stream JSON' % protocol, fatal=False)
|
||||||
if stream and stream.get(protocol):
|
if stream and stream.get(protocol):
|
||||||
extract_formats(protocol, stream[protocol])
|
extract_formats(protocol, stream[protocol])
|
||||||
else:
|
|
||||||
|
# The last resort is to try direct unsigned hls/hds URLs from info dictionary.
|
||||||
|
# Sometimes this does work even when secure API with dsc-geo has failed (e.g.
|
||||||
|
# http://www.dplay.no/pga-tour/season-1-hoydepunkter-18-21-februar/).
|
||||||
|
if not formats:
|
||||||
for protocol in PROTOCOLS:
|
for protocol in PROTOCOLS:
|
||||||
if info.get(protocol):
|
if info.get(protocol):
|
||||||
extract_formats(protocol, info[protocol])
|
extract_formats(protocol, info[protocol])
|
||||||
|
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
subtitles = {}
|
||||||
|
for lang in ('se', 'sv', 'da', 'nl', 'no'):
|
||||||
|
for format_id in ('web_vtt', 'vtt', 'srt'):
|
||||||
|
subtitle_url = info.get('subtitles_%s_%s' % (lang, format_id))
|
||||||
|
if subtitle_url:
|
||||||
|
subtitles.setdefault(lang, []).append({'url': subtitle_url})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'display_id': display_id,
|
'display_id': display_id,
|
||||||
@@ -133,4 +159,5 @@ class DPlayIE(InfoExtractor):
|
|||||||
'episode_number': int_or_none(info.get('episode')),
|
'episode_number': int_or_none(info.get('episode')),
|
||||||
'age_limit': int_or_none(info.get('minimum_age')),
|
'age_limit': int_or_none(info.get('minimum_age')),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
|
'subtitles': subtitles,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
# encoding: utf-8
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
|
||||||
|
|
||||||
|
|
||||||
class DumpIE(InfoExtractor):
|
|
||||||
_VALID_URL = r'^https?://(?:www\.)?dump\.com/(?P<id>[a-zA-Z0-9]+)/'
|
|
||||||
|
|
||||||
_TEST = {
|
|
||||||
'url': 'http://www.dump.com/oneus/',
|
|
||||||
'md5': 'ad71704d1e67dfd9e81e3e8b42d69d99',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'oneus',
|
|
||||||
'ext': 'flv',
|
|
||||||
'title': "He's one of us.",
|
|
||||||
'thumbnail': 're:^https?://.*\.jpg$',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
m = re.match(self._VALID_URL, url)
|
|
||||||
video_id = m.group('id')
|
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
|
||||||
video_url = self._search_regex(
|
|
||||||
r's1.addVariable\("file",\s*"([^"]+)"', webpage, 'video URL')
|
|
||||||
|
|
||||||
title = self._og_search_title(webpage)
|
|
||||||
thumbnail = self._og_search_thumbnail(webpage)
|
|
||||||
|
|
||||||
return {
|
|
||||||
'id': video_id,
|
|
||||||
'title': title,
|
|
||||||
'url': video_url,
|
|
||||||
'thumbnail': thumbnail,
|
|
||||||
}
|
|
||||||
@@ -2,13 +2,16 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import int_or_none
|
from ..utils import (
|
||||||
|
int_or_none,
|
||||||
|
unified_strdate,
|
||||||
|
)
|
||||||
from ..compat import compat_urlparse
|
from ..compat import compat_urlparse
|
||||||
|
|
||||||
|
|
||||||
class DWIE(InfoExtractor):
|
class DWIE(InfoExtractor):
|
||||||
IE_NAME = 'dw'
|
IE_NAME = 'dw'
|
||||||
_VALID_URL = r'https?://(?:www\.)?dw\.com/(?:[^/]+/)+av-(?P<id>\d+)'
|
_VALID_URL = r'https?://(?:www\.)?dw\.com/(?:[^/]+/)+(?:av|e)-(?P<id>\d+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
# video
|
# video
|
||||||
'url': 'http://www.dw.com/en/intelligent-light/av-19112290',
|
'url': 'http://www.dw.com/en/intelligent-light/av-19112290',
|
||||||
@@ -31,6 +34,18 @@ class DWIE(InfoExtractor):
|
|||||||
'description': 'md5:bc9ca6e4e063361e21c920c53af12405',
|
'description': 'md5:bc9ca6e4e063361e21c920c53af12405',
|
||||||
'upload_date': '20160311',
|
'upload_date': '20160311',
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
# DW documentaries, only last for one or two weeks
|
||||||
|
'url': 'http://www.dw.com/en/documentaries-welcome-to-the-90s-2016-05-21/e-19220158-9798',
|
||||||
|
'md5': '56b6214ef463bfb9a3b71aeb886f3cf1',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '19274438',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Welcome to the 90s – Hip Hop',
|
||||||
|
'description': 'Welcome to the 90s - The Golden Decade of Hip Hop',
|
||||||
|
'upload_date': '20160521',
|
||||||
|
},
|
||||||
|
'skip': 'Video removed',
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
@@ -38,6 +53,7 @@ class DWIE(InfoExtractor):
|
|||||||
webpage = self._download_webpage(url, media_id)
|
webpage = self._download_webpage(url, media_id)
|
||||||
hidden_inputs = self._hidden_inputs(webpage)
|
hidden_inputs = self._hidden_inputs(webpage)
|
||||||
title = hidden_inputs['media_title']
|
title = hidden_inputs['media_title']
|
||||||
|
media_id = hidden_inputs.get('media_id') or media_id
|
||||||
|
|
||||||
if hidden_inputs.get('player_type') == 'video' and hidden_inputs.get('stream_file') == '1':
|
if hidden_inputs.get('player_type') == 'video' and hidden_inputs.get('stream_file') == '1':
|
||||||
formats = self._extract_smil_formats(
|
formats = self._extract_smil_formats(
|
||||||
@@ -49,13 +65,20 @@ class DWIE(InfoExtractor):
|
|||||||
else:
|
else:
|
||||||
formats = [{'url': hidden_inputs['file_name']}]
|
formats = [{'url': hidden_inputs['file_name']}]
|
||||||
|
|
||||||
|
upload_date = hidden_inputs.get('display_date')
|
||||||
|
if not upload_date:
|
||||||
|
upload_date = self._html_search_regex(
|
||||||
|
r'<span[^>]+class="date">([0-9.]+)\s*\|', webpage,
|
||||||
|
'upload date', default=None)
|
||||||
|
upload_date = unified_strdate(upload_date)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': media_id,
|
'id': media_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'description': self._og_search_description(webpage),
|
'description': self._og_search_description(webpage),
|
||||||
'thumbnail': hidden_inputs.get('preview_image'),
|
'thumbnail': hidden_inputs.get('preview_image'),
|
||||||
'duration': int_or_none(hidden_inputs.get('file_duration')),
|
'duration': int_or_none(hidden_inputs.get('file_duration')),
|
||||||
'upload_date': hidden_inputs.get('display_date'),
|
'upload_date': upload_date,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ from __future__ import unicode_literals
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from ..compat import compat_HTTPError
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
|
url_basename,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -21,7 +23,7 @@ class EaglePlatformIE(InfoExtractor):
|
|||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
# http://lenta.ru/news/2015/03/06/navalny/
|
# http://lenta.ru/news/2015/03/06/navalny/
|
||||||
'url': 'http://lentaru.media.eagleplatform.com/index/player?player=new&record_id=227304&player_template_id=5201',
|
'url': 'http://lentaru.media.eagleplatform.com/index/player?player=new&record_id=227304&player_template_id=5201',
|
||||||
'md5': '70f5187fb620f2c1d503b3b22fd4efe3',
|
# Not checking MD5 as sometimes the direct HTTP link results in 404 and HLS is used
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '227304',
|
'id': '227304',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@@ -36,7 +38,7 @@ class EaglePlatformIE(InfoExtractor):
|
|||||||
# http://muz-tv.ru/play/7129/
|
# http://muz-tv.ru/play/7129/
|
||||||
# http://media.clipyou.ru/index/player?record_id=12820&width=730&height=415&autoplay=true
|
# http://media.clipyou.ru/index/player?record_id=12820&width=730&height=415&autoplay=true
|
||||||
'url': 'eagleplatform:media.clipyou.ru:12820',
|
'url': 'eagleplatform:media.clipyou.ru:12820',
|
||||||
'md5': '90b26344ba442c8e44aa4cf8f301164a',
|
'md5': '358597369cf8ba56675c1df15e7af624',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '12820',
|
'id': '12820',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@@ -48,6 +50,14 @@ class EaglePlatformIE(InfoExtractor):
|
|||||||
'skip': 'Georestricted',
|
'skip': 'Georestricted',
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _extract_url(webpage):
|
||||||
|
mobj = re.search(
|
||||||
|
r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//.+?\.media\.eagleplatform\.com/index/player\?.+?)\1',
|
||||||
|
webpage)
|
||||||
|
if mobj is not None:
|
||||||
|
return mobj.group('url')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _handle_error(response):
|
def _handle_error(response):
|
||||||
status = int_or_none(response.get('status', 200))
|
status = int_or_none(response.get('status', 200))
|
||||||
@@ -55,8 +65,13 @@ class EaglePlatformIE(InfoExtractor):
|
|||||||
raise ExtractorError(' '.join(response['errors']), expected=True)
|
raise ExtractorError(' '.join(response['errors']), expected=True)
|
||||||
|
|
||||||
def _download_json(self, url_or_request, video_id, note='Downloading JSON metadata'):
|
def _download_json(self, url_or_request, video_id, note='Downloading JSON metadata'):
|
||||||
response = super(EaglePlatformIE, self)._download_json(url_or_request, video_id, note)
|
try:
|
||||||
self._handle_error(response)
|
response = super(EaglePlatformIE, self)._download_json(url_or_request, video_id, note)
|
||||||
|
except ExtractorError as ee:
|
||||||
|
if isinstance(ee.cause, compat_HTTPError):
|
||||||
|
response = self._parse_json(ee.cause.read().decode('utf-8'), video_id)
|
||||||
|
self._handle_error(response)
|
||||||
|
raise
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def _get_video_url(self, url_or_request, video_id, note='Downloading JSON metadata'):
|
def _get_video_url(self, url_or_request, video_id, note='Downloading JSON metadata'):
|
||||||
@@ -84,17 +99,33 @@ class EaglePlatformIE(InfoExtractor):
|
|||||||
|
|
||||||
secure_m3u8 = self._proto_relative_url(media['sources']['secure_m3u8']['auto'], 'http:')
|
secure_m3u8 = self._proto_relative_url(media['sources']['secure_m3u8']['auto'], 'http:')
|
||||||
|
|
||||||
|
formats = []
|
||||||
|
|
||||||
m3u8_url = self._get_video_url(secure_m3u8, video_id, 'Downloading m3u8 JSON')
|
m3u8_url = self._get_video_url(secure_m3u8, video_id, 'Downloading m3u8 JSON')
|
||||||
formats = self._extract_m3u8_formats(
|
m3u8_formats = self._extract_m3u8_formats(
|
||||||
m3u8_url, video_id,
|
m3u8_url, video_id,
|
||||||
'mp4', entry_protocol='m3u8_native', m3u8_id='hls')
|
'mp4', entry_protocol='m3u8_native', m3u8_id='hls')
|
||||||
|
formats.extend(m3u8_formats)
|
||||||
|
|
||||||
mp4_url = self._get_video_url(
|
mp4_url = self._get_video_url(
|
||||||
# Secure mp4 URL is constructed according to Player.prototype.mp4 from
|
# Secure mp4 URL is constructed according to Player.prototype.mp4 from
|
||||||
# http://lentaru.media.eagleplatform.com/player/player.js
|
# http://lentaru.media.eagleplatform.com/player/player.js
|
||||||
re.sub(r'm3u8|hlsvod|hls|f4m', 'mp4', secure_m3u8),
|
re.sub(r'm3u8|hlsvod|hls|f4m', 'mp4', secure_m3u8),
|
||||||
video_id, 'Downloading mp4 JSON')
|
video_id, 'Downloading mp4 JSON')
|
||||||
formats.append({'url': mp4_url, 'format_id': 'mp4'})
|
mp4_url_basename = url_basename(mp4_url)
|
||||||
|
for m3u8_format in m3u8_formats:
|
||||||
|
mobj = re.search('/([^/]+)/index\.m3u8', m3u8_format['url'])
|
||||||
|
if mobj:
|
||||||
|
http_format = m3u8_format.copy()
|
||||||
|
video_url = mp4_url.replace(mp4_url_basename, mobj.group(1))
|
||||||
|
if not self._is_valid_url(video_url, video_id):
|
||||||
|
continue
|
||||||
|
http_format.update({
|
||||||
|
'url': video_url,
|
||||||
|
'format_id': m3u8_format['format_id'].replace('hls', 'http'),
|
||||||
|
'protocol': 'http',
|
||||||
|
})
|
||||||
|
formats.append(http_format)
|
||||||
|
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ from .common import InfoExtractor
|
|||||||
|
|
||||||
|
|
||||||
class EbaumsWorldIE(InfoExtractor):
|
class EbaumsWorldIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://www\.ebaumsworld\.com/video/watch/(?P<id>\d+)'
|
_VALID_URL = r'https?://(?:www\.)?ebaumsworld\.com/videos/[^/]+/(?P<id>\d+)'
|
||||||
|
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://www.ebaumsworld.com/video/watch/83367677/',
|
'url': 'http://www.ebaumsworld.com/videos/a-giant-python-opens-the-door/83367677/',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '83367677',
|
'id': '83367677',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ from ..utils import (
|
|||||||
|
|
||||||
|
|
||||||
class EpornerIE(InfoExtractor):
|
class EpornerIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?eporner\.com/hd-porn/(?P<id>\d+)/(?P<display_id>[\w-]+)'
|
_VALID_URL = r'https?://(?:www\.)?eporner\.com/hd-porn/(?P<id>\w+)/(?P<display_id>[\w-]+)'
|
||||||
_TEST = {
|
_TESTS = [{
|
||||||
'url': 'http://www.eporner.com/hd-porn/95008/Infamous-Tiffany-Teen-Strip-Tease-Video/',
|
'url': 'http://www.eporner.com/hd-porn/95008/Infamous-Tiffany-Teen-Strip-Tease-Video/',
|
||||||
'md5': '39d486f046212d8e1b911c52ab4691f8',
|
'md5': '39d486f046212d8e1b911c52ab4691f8',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
@@ -23,8 +23,12 @@ class EpornerIE(InfoExtractor):
|
|||||||
'duration': 1838,
|
'duration': 1838,
|
||||||
'view_count': int,
|
'view_count': int,
|
||||||
'age_limit': 18,
|
'age_limit': 18,
|
||||||
}
|
},
|
||||||
}
|
}, {
|
||||||
|
# New (May 2016) URL layout
|
||||||
|
'url': 'http://www.eporner.com/hd-porn/3YRUtzMcWn0/Star-Wars-XXX-Parody/',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ class ESPNIE(InfoExtractor):
|
|||||||
_VALID_URL = r'https?://espn\.go\.com/(?:[^/]+/)*(?P<id>[^/]+)'
|
_VALID_URL = r'https?://espn\.go\.com/(?:[^/]+/)*(?P<id>[^/]+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://espn.go.com/video/clip?id=10365079',
|
'url': 'http://espn.go.com/video/clip?id=10365079',
|
||||||
|
'md5': '60e5d097a523e767d06479335d1bdc58',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'FkYWtmazr6Ed8xmvILvKLWjd4QvYZpzG',
|
'id': 'FkYWtmazr6Ed8xmvILvKLWjd4QvYZpzG',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@@ -15,21 +16,22 @@ class ESPNIE(InfoExtractor):
|
|||||||
'description': None,
|
'description': None,
|
||||||
},
|
},
|
||||||
'params': {
|
'params': {
|
||||||
# m3u8 download
|
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
|
'add_ie': ['OoyalaExternal'],
|
||||||
}, {
|
}, {
|
||||||
# intl video, from http://www.espnfc.us/video/mls-highlights/150/video/2743663/must-see-moments-best-of-the-mls-season
|
# intl video, from http://www.espnfc.us/video/mls-highlights/150/video/2743663/must-see-moments-best-of-the-mls-season
|
||||||
'url': 'http://espn.go.com/video/clip?id=2743663',
|
'url': 'http://espn.go.com/video/clip?id=2743663',
|
||||||
|
'md5': 'f4ac89b59afc7e2d7dbb049523df6768',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '50NDFkeTqRHB0nXBOK-RGdSG5YQPuxHg',
|
'id': '50NDFkeTqRHB0nXBOK-RGdSG5YQPuxHg',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Must-See Moments: Best of the MLS season',
|
'title': 'Must-See Moments: Best of the MLS season',
|
||||||
},
|
},
|
||||||
'params': {
|
'params': {
|
||||||
# m3u8 download
|
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
|
'add_ie': ['OoyalaExternal'],
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://espn.go.com/video/iframe/twitter/?cms=espn&id=10365079',
|
'url': 'https://espn.go.com/video/iframe/twitter/?cms=espn&id=10365079',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
|
|||||||
1082
youtube_dl/extractor/extractors.py
Normal file
1082
youtube_dl/extractor/extractors.py
Normal file
File diff suppressed because it is too large
Load Diff
64
youtube_dl/extractor/eyedotv.py
Normal file
64
youtube_dl/extractor/eyedotv.py
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
xpath_text,
|
||||||
|
parse_duration,
|
||||||
|
ExtractorError,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class EyedoTVIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?eyedo\.tv/[^/]+/(?:#!/)?Live/Detail/(?P<id>[0-9]+)'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'https://www.eyedo.tv/en-US/#!/Live/Detail/16301',
|
||||||
|
'md5': 'ba14f17995cdfc20c36ba40e21bf73f7',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '16301',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Journée du conseil scientifique de l\'Afnic 2015',
|
||||||
|
'description': 'md5:4abe07293b2f73efc6e1c37028d58c98',
|
||||||
|
'uploader': 'Afnic Live',
|
||||||
|
'uploader_id': '8023',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ROOT_URL = 'http://live.eyedo.net:1935/'
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
video_data = self._download_xml('http://eyedo.tv/api/live/GetLive/%s' % video_id, video_id)
|
||||||
|
|
||||||
|
def _add_ns(path):
|
||||||
|
return self._xpath_ns(path, 'http://schemas.datacontract.org/2004/07/EyeDo.Core.Implementation.Web.ViewModels.Api')
|
||||||
|
|
||||||
|
title = xpath_text(video_data, _add_ns('Titre'), 'title', True)
|
||||||
|
state_live_code = xpath_text(video_data, _add_ns('StateLiveCode'), 'title', True)
|
||||||
|
if state_live_code == 'avenir':
|
||||||
|
raise ExtractorError(
|
||||||
|
'%s said: We\'re sorry, but this video is not yet available.' % self.IE_NAME,
|
||||||
|
expected=True)
|
||||||
|
|
||||||
|
is_live = state_live_code == 'live'
|
||||||
|
m3u8_url = None
|
||||||
|
# http://eyedo.tv/Content/Html5/Scripts/html5view.js
|
||||||
|
if is_live:
|
||||||
|
if xpath_text(video_data, 'Cdn') == 'true':
|
||||||
|
m3u8_url = 'http://rrr.sz.xlcdn.com/?account=eyedo&file=A%s&type=live&service=wowza&protocol=http&output=playlist.m3u8' % video_id
|
||||||
|
else:
|
||||||
|
m3u8_url = self._ROOT_URL + 'w/%s/eyedo_720p/playlist.m3u8' % video_id
|
||||||
|
else:
|
||||||
|
m3u8_url = self._ROOT_URL + 'replay-w/%s/mp4:%s.mp4/playlist.m3u8' % (video_id, video_id)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': title,
|
||||||
|
'formats': self._extract_m3u8_formats(
|
||||||
|
m3u8_url, video_id, 'mp4', 'm3u8' if is_live else 'm3u8_native'),
|
||||||
|
'description': xpath_text(video_data, _add_ns('Description')),
|
||||||
|
'duration': parse_duration(xpath_text(video_data, _add_ns('Duration'))),
|
||||||
|
'uploader': xpath_text(video_data, _add_ns('Createur')),
|
||||||
|
'uploader_id': xpath_text(video_data, _add_ns('CreateurId')),
|
||||||
|
'chapter': xpath_text(video_data, _add_ns('ChapitreTitre')),
|
||||||
|
'chapter_id': xpath_text(video_data, _add_ns('ChapitreId')),
|
||||||
|
}
|
||||||
@@ -129,6 +129,21 @@ class FacebookIE(InfoExtractor):
|
|||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _extract_url(webpage):
|
||||||
|
mobj = re.search(
|
||||||
|
r'<iframe[^>]+?src=(["\'])(?P<url>https://www\.facebook\.com/video/embed.+?)\1', webpage)
|
||||||
|
if mobj is not None:
|
||||||
|
return mobj.group('url')
|
||||||
|
|
||||||
|
# Facebook API embed
|
||||||
|
# see https://developers.facebook.com/docs/plugins/embedded-video-player
|
||||||
|
mobj = re.search(r'''(?x)<div[^>]+
|
||||||
|
class=(?P<q1>[\'"])[^\'"]*\bfb-video\b[^\'"]*(?P=q1)[^>]+
|
||||||
|
data-href=(?P<q2>[\'"])(?P<url>(?:https?:)?//(?:www\.)?facebook.com/.+?)(?P=q2)''', webpage)
|
||||||
|
if mobj is not None:
|
||||||
|
return mobj.group('url')
|
||||||
|
|
||||||
def _login(self):
|
def _login(self):
|
||||||
(useremail, password) = self._get_login_info()
|
(useremail, password) = self._get_login_info()
|
||||||
if useremail is None:
|
if useremail is None:
|
||||||
@@ -239,6 +254,8 @@ class FacebookIE(InfoExtractor):
|
|||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
for format_id, f in video_data.items():
|
for format_id, f in video_data.items():
|
||||||
|
if f and isinstance(f, dict):
|
||||||
|
f = [f]
|
||||||
if not f or not isinstance(f, list):
|
if not f or not isinstance(f, list):
|
||||||
continue
|
continue
|
||||||
for quality in ('sd', 'hd'):
|
for quality in ('sd', 'hd'):
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from ..compat import compat_urlparse
|
||||||
|
|
||||||
|
|
||||||
class FczenitIE(InfoExtractor):
|
class FczenitIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?fc-zenit\.ru/video/gl(?P<id>[0-9]+)'
|
_VALID_URL = r'https?://(?:www\.)?fc-zenit\.ru/video/(?P<id>[0-9]+)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://fc-zenit.ru/video/gl6785/',
|
'url': 'http://fc-zenit.ru/video/41044/',
|
||||||
'md5': '458bacc24549173fe5a5aa29174a5606',
|
'md5': '0e3fab421b455e970fa1aa3891e57df0',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '6785',
|
'id': '41044',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': '«Зенит-ТВ»: как Олег Шатов играл против «Урала»',
|
'title': 'Так пишется история: казанский разгром ЦСКА на «Зенит-ТВ»',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,15 +21,23 @@ class FczenitIE(InfoExtractor):
|
|||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
video_title = self._html_search_regex(r'<div class=\"photoalbum__title\">([^<]+)', webpage, 'title')
|
video_title = self._html_search_regex(
|
||||||
|
r'<[^>]+class=\"photoalbum__title\">([^<]+)', webpage, 'title')
|
||||||
|
|
||||||
bitrates_raw = self._html_search_regex(r'bitrates:.*\n(.*)\]', webpage, 'video URL')
|
video_items = self._parse_json(self._search_regex(
|
||||||
bitrates = re.findall(r'url:.?\'(.+?)\'.*?bitrate:.?([0-9]{3}?)', bitrates_raw)
|
r'arrPath\s*=\s*JSON\.parse\(\'(.+)\'\)', webpage, 'video items'),
|
||||||
|
video_id)
|
||||||
|
|
||||||
|
def merge_dicts(*dicts):
|
||||||
|
ret = {}
|
||||||
|
for a_dict in dicts:
|
||||||
|
ret.update(a_dict)
|
||||||
|
return ret
|
||||||
|
|
||||||
formats = [{
|
formats = [{
|
||||||
'url': furl,
|
'url': compat_urlparse.urljoin(url, video_url),
|
||||||
'tbr': tbr,
|
'tbr': int(tbr),
|
||||||
} for furl, tbr in bitrates]
|
} for tbr, video_url in merge_dicts(*video_items).items()]
|
||||||
|
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user