~ubuntu-branches/ubuntu/vivid/youtube-dl/vivid

« back to all changes in this revision

Viewing changes to test/test_youtube_signature.py

  • Committer: Package Import Robot
  • Author(s): Rogério Brito
  • Date: 2015-03-01 02:12:13 UTC
  • mfrom: (44.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20150301021213-8w657cue71kp77sz
Tags: 2015.02.28-1
Imported Upstream version 2015.02.28. Closes: #778765.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
import unittest
9
9
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
10
10
 
11
 
 
12
11
import io
13
12
import re
14
13
import string
15
14
 
 
15
from test.helper import FakeYDL
16
16
from youtube_dl.extractor import YoutubeIE
17
17
from youtube_dl.compat import compat_str, compat_urlretrieve
18
18
 
64
64
        'js',
65
65
        '4646B5181C6C3020DF1D9C7FCFEA.AD80ABF70C39BD369CCCAE780AFBB98FA6B6CB42766249D9488C288',
66
66
        '82C8849D94266724DC6B6AF89BBFA087EACCD963.B93C07FBA084ACAEFCF7C9D1FD0203C6C1815B6B'
 
67
    ),
 
68
    (
 
69
        'https://s.ytimg.com/yts/jsbin/html5player-en_US-vflKjOTVq/html5player.js',
 
70
        'js',
 
71
        '312AA52209E3623129A412D56A40F11CB0AF14AE.3EE09501CB14E3BCDC3B2AE808BF3F1D14E7FBF12',
 
72
        '112AA5220913623229A412D56A40F11CB0AF14AE.3EE0950FCB14EEBCDC3B2AE808BF331D14E7FBF3',
67
73
    )
68
74
]
69
75
 
88
94
        if not os.path.exists(fn):
89
95
            compat_urlretrieve(url, fn)
90
96
 
91
 
        ie = YoutubeIE()
 
97
        ydl = FakeYDL()
 
98
        ie = YoutubeIE(ydl)
92
99
        if stype == 'js':
93
100
            with io.open(fn, encoding='utf-8') as testf:
94
101
                jscode = testf.read()