1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-12-17 06:35:42 +07:00

[washingtonpost] Add extractor (Fixes #2622)

This commit is contained in:
Philipp Hagemeister
2014-03-24 23:21:20 +01:00
parent 7a249480b4
commit fac55558ad
4 changed files with 116 additions and 0 deletions

View File

@@ -10,6 +10,7 @@
# Various small unit tests
import io
import json
import xml.etree.ElementTree
#from youtube_dl.utils import htmlentity_transform
@@ -36,6 +37,7 @@
urlencode_postdata,
xpath_with_ns,
parse_iso8601,
strip_jsonp,
)
if sys.version_info < (3, 0):
@@ -272,5 +274,11 @@ def test_parse_iso8601(self):
self.assertEqual(parse_iso8601('2014-03-23T22:04:26+0000'), 1395612266)
self.assertEqual(parse_iso8601('2014-03-23T22:04:26Z'), 1395612266)
def test_strip_jsonp(self):
stripped = strip_jsonp('cb ([ {"id":"532cb",\n\n\n"x":\n3}\n]\n);')
d = json.loads(stripped)
self.assertEqual(d, [{"id": "532cb", "x": 3}])
if __name__ == '__main__':
unittest.main()