Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tv2] TV2 extractor fails for most/all recent videos #22787

Closed
vonstring opened this issue Oct 21, 2019 · 0 comments
Closed

[tv2] TV2 extractor fails for most/all recent videos #22787

vonstring opened this issue Oct 21, 2019 · 0 comments

Comments

@vonstring
Copy link

@vonstring vonstring commented Oct 21, 2019

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2019.10.16
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones

Verbose log

Log:

>youtube-dl -v "https://www.tv2.no/v/1506773/"
[debug] System config: []
[debug] User config: ['--no-mtime', '-f', 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4']
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.tv2.no/v/1506773/']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2019.10.16
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.17763
[debug] exe versions: ffmpeg N-93103-gd20902fd23, ffprobe N-93103-gd20902fd23
[debug] Proxy map: {}
[TV2] 1506773: Downloading play JSON
Traceback (most recent call last):
  File "__main__.py", line 19, in <module>
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpfc5s43s4\build\youtube_dl\__init__.py", line 474, in main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpfc5s43s4\build\youtube_dl\__init__.py", line 464, in _real_main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpfc5s43s4\build\youtube_dl\YoutubeDL.py", line 2018, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpfc5s43s4\build\youtube_dl\YoutubeDL.py", line 796, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpfc5s43s4\build\youtube_dl\extractor\common.py", line 530, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpfc5s43s4\build\youtube_dl\extractor\tv2.py", line 48, in _real_extract
AttributeError: 'str' object has no attribute 'get'

Description

The TV 2 extractor fails for most/all videos from the last few years. Older video URLs still work fine.

The issue seems to be that the extractor expects an array in 'items' in the JSON data retrieved from the website, whereas for newer videos it will return only a single dictionary with one item.

Old video (working, array of items):
http://sumo.tv2.no/api/web/asset/916509/play.json?protocol=HLS&videoFormat=SMIL+ISMUSP

{                                                                                                                                                                                                                                                                               
    "playback": {                                                                                                                                                                                                                                                               
        "@assetId": "916509",                                                                                                                                                                                                                                                   
        "aspect16x9": true,                                                                                                                                                                                                                                                     
        "drmProtected": false,                                                                                                                                                                                                                                                  
        "hasItems": false,                                                                                                                                                                                                                                                      
        "items": {                                                                                                                                                                                                                                                              
            "item": [                                                                                                                                                                                                                                                           
                {                                                                                                                                                                                                                                                               
                    "base": "http://stream-od.akamaized.net/ismusp",                                                                                                                                                                                                            
                    "bitrate": 0,                                                                                                                                                                                                                                               
                    "drmProxyType": "fairplay",                                                                                                                                                                                                                                 
                    "fileSize": 12665,                                                                                                                                                                                                                                          
                    "license": {                                                                                                                                                                                                                                                
                        "@name": "fairplay",                                                                                                                                                                                                                                    
                        "@uri": "https://sumo.tv2.no/license/fairplay/916509?timeStamp=2019-10-21T08%3A22%3A19%2B0000&contract=59abbe977fbc4a7aadb3068725682500&account=source",                                                                                                
                        "drm": {                                                                                                                                                                                                                                                
                            "license": {                                                                                                                                                                                                                                        
                                "@name": "fairplay",                                                                                                                                                                                                                            
                                "@uri": "https://sumo.tv2.no/license/fairplay/916509?timeStamp=2019-10-21T08%3A22%3A19%2B0000&contract=59abbe977fbc4a7aadb3068725682500&account=source"                                                                                         
                            }                                                                                                                                                                                                                                                   
                        }                                                                                                                                                                                                                                                       
                    },                                                                                                                                                                                                                                                          
                    "log": {                                                                                                                                                                                                                                                    
                        "@uri": "/api/web/asset/916509/play/log/7404879/"                                                                                                                                                                                                       
                    },                                                                                                                                                                                                                                                          
                    "mediaFormat": "ismusp",                                                                                                                                                                                                                                    
                    "protocol": "HLS",                                                                                                                                                                                                                                          
                    "scheme": "http",                                                                                                                                                                                                                                           
                    "server": "stream-od.akamaized.net",                                                                                                                                                                                                                        
                    "url": "http://stream-od.akamaized.net/ismusp/isi_mp4_0/2015-05-15/S_GRYTTENGERRARD_150515_(916509_ISMUSP).ism/S_GRYTTENGERRARD_150515_(916509_ISMUSP).m3u8"                                                                                                
                },                                                                                                                                                                                                                                                              
                {                                                                                                                                                                                                                                                               
                    "base": "https://stream-od.akamaized.net/hlsvod16/_definst_",                                                                                                                                                                                               
                    "bitrate": 0,                                                                                                                                                                                                                                               
                    "drmProxyType": "fairplay",                                                                                                                                                                                                                                 
                    "fileSize": 794,                                                                                                                                                                                                                                            
                    "license": {                                                                                                                                                                                                                                                
                        "@name": "fairplay",                                                                                                                                                                                                                                    
                        "@uri": "https://sumo.tv2.no/license/fairplay/916509?timeStamp=2019-10-21T08%3A22%3A19%2B0000&contract=59abbe977fbc4a7aadb3068725682500&account=source",                                                                                                
                        "drm": {                                                                                                                                                                                                                                                
                            "license": {                                                                                                                                                                                                                                        
                                "@name": "fairplay",                                                                                                                                                                                                                            
                                "@uri": "https://sumo.tv2.no/license/fairplay/916509?timeStamp=2019-10-21T08%3A22%3A19%2B0000&contract=59abbe977fbc4a7aadb3068725682500&account=source"                                                                                         
                            }                                                                                                                                                                                                                                                   
                        }                                                                                                                                                                                                                                                       
                    },                                                                                                                                                                                                                                                          
                    "log": {                                                                                                                                                                                                                                                    
                        "@uri": "/api/web/asset/916509/play/log/7404870/"                                                                                                                                                                                                       
                    },                                                                                                                                                                                                                                                          
                    "mediaFormat": "smil",                                                                                                                                                                                                                                      
                    "protocol": "HLS",                                                                                                                                                                                                                                          
                    "scheme": "https",                                                                                                                                                                                                                                          
                    "server": "stream-od.akamaized.net",                                                                                                                                                                                                                        
                    "url": "https://stream-od.akamaized.net/hlsvod16/_definst_/amlst:916509.smil/playlist.m3u8"                                                                                                                                                                 
                }                                                                                                                                                                                                                                                               
            ]                                                                                                                                                                                                                                                                   
        },                                                                                                                                                                                                                                                                      
        "live": false,                                                                                                                                                                                                                                                          
        "liveBroadcastTime": "2015-05-15T20:46:50+02:00",                                                                                                                                                                                                                       
        "logData": "2D814881DF7DFEAFEBF9534741BBF34F37334803A1C9317191680551A273269FF44E6BA30F4E814CAA92FFF68EDFB54D840E03511135CD3269E88BA3B299361A8C9490DF7DF879A8D35CA21FD99FB2DCFC4E94A4B3759F0138D83EB021E576251A6A695452C90247B599124757F7A6EDD5917789CDAA285B98AACC5A258D
BB1481125E207E2742A48F844807CCCC496291EAE8FF5C5720EEFE59C028E918A8ED92AB03CB2603BA5B1FA8D2A33650522AAC788EC58D6143872C5B891B040C32A7370B0EE542B67719DB29EB35B6C2CBCD44D616A336C4A33E82DCC94A56AA1246BF5BC2CAFE0AC0A107EB170685801C8F04F13C7C8B005D50A9258FEE6A6E252B2C0F3F53A755
6C92DBE307CD81FE8606178528A83C5EF2C71DA3DA7B6F1F75A7855602BEE67999A3",                                                                                                                                                                                                          
        "playbackStatus": "OK",                                                                                                                                                                                                                                                 
        "streamRule": {                                                                                                                                                                                                                                                         
            "maxSubscriptionStreams": 4                                                                                                                                                                                                                                         
        },                                                                                                                                                                                                                                                                      
        "title": "Se Frode Gryttens hyllest av Steven Gerrard"                                                                                                                                                                                                                  
    }                                                                                                                                                                                                                                                                           
}                                                                                                                                                                                                                                                                               

Newer video (failing, single item dictionary):
http://sumo.tv2.no/api/web/asset/1506773/play.json?protocol=HLSvideoFormat=SMIL+ISMUSP

{                                                                                                                                                                                                                                                                               
    "playback": {                                                                                                                                                                                                                                                               
        "@assetId": "1506773",                                                                                                                                                                                                                                                  
        "aspect16x9": true,                                                                                                                                                                                                                                                     
        "drmProtected": false,                                                                                                                                                                                                                                                  
        "hasItems": false,                                                                                                                                                                                                                                                      
        "items": {                                                                                                                                                                                                                                                              
            "item": {                                                                                                                                                                                                                                                           
                "base": "https://stream-od.akamaized.net/hlsvod16/_definst_",                                                                                                                                                                                                   
                "bitrate": 0,                                                                                                                                                                                                                                                   
                "drmProxyType": "fairplay",                                                                                                                                                                                                                                     
                "fileSize": 509,                                                                                                                                                                                                                                                
                "license": {                                                                                                                                                                                                                                                    
                    "@name": "fairplay",                                                                                                                                                                                                                                        
                    "@uri": "https://sumo.tv2.no/license/fairplay/1506773?timeStamp=2019-10-21T08%3A22%3A42%2B0000&contract=1568a5bc149292e96301624ae13dcd19&account=source",                                                                                                   
                    "drm": {                                                                                                                                                                                                                                                    
                        "license": {                                                                                                                                                                                                                                            
                            "@name": "fairplay",                                                                                                                                                                                                                                
                            "@uri": "https://sumo.tv2.no/license/fairplay/1506773?timeStamp=2019-10-21T08%3A22%3A42%2B0000&contract=1568a5bc149292e96301624ae13dcd19&account=source"                                                                                            
                        }                                                                                                                                                                                                                                                       
                    }                                                                                                                                                                                                                                                           
                },                                                                                                                                                                                                                                                              
                "log": {                                                                                                                                                                                                                                                        
                    "@uri": "/api/web/asset/1506773/play/log/11156918/"                                                                                                                                                                                                         
                },                                                                                                                                                                                                                                                              
                "mediaFormat": "smil",                                                                                                                                                                                                                                          
                "protocol": "HLS",                                                                                                                                                                                                                                              
                "scheme": "https",                                                                                                                                                                                                                                              
                "server": "stream-od.akamaized.net",                                                                                                                                                                                                                            
                "url": "https://stream-od.akamaized.net/hlsvod16/_definst_/amlst:1506773_ps3477_pd86658.smil/playlist.m3u8"                                                                                                                                                     
            }                                                                                                                                                                                                                                                                   
        },                                                                                                                                                                                                                                                                      
        "live": false,                                                                                                                                                                                                                                                          
        "liveBroadcastTime": "2019-10-20T13:26:33+02:00",                                                                                                                                                                                                                       
        "logData": "228AAB03928923AE347C28623FC53E0452D1D8E7FC1F84FE8DFA756E52CAD592EFABC14CBCE7E4D9C78C108B59F25773B6DC43BE20C7A12D75BE70F7CD36803490E3D453DF894A21F04C850FF16AF6F3034074D25C5038D6EA35CDDB12C3E36086042F3A3CD28C224260BE45F3ADAC651D20AFC983BB36058EA32D78E685
31EFB3B5BA5497F7E8FE62DD461889D9A0DF6288D25F423EE7EE8E391A4B97693995C6E5E52A27AC76D2FCB6E39B9097644A88F58443B72DAA65300979747AC2A68905BAD2B11553495529E19C7A8FAAEB3FBCB05944D86184FFA479A78C81CF8D274F85E5BAD7F66F338E7EBB2D778759E7182901F3803BE5C4065496274DB05490712742248F81
8A163DFB9DC1EC58822A60F9C03393CE76E08CB5ECC22AFE1ADA4319DAF02E4A61D4123BD031F4C4F451",                                                                                                                                                                                          
        "playbackStatus": "OK",                                                                                                                                                                                                                                                 
        "streamRule": {                                                                                                                                                                                                                                                         
            "maxSubscriptionStreams": 4                                                                                                                                                                                                                                         
        },                                                                                                                                                                                                                                                                      
        "title": "Feiret med spektakul\u00e6r salto i supporterkampen"                                                                                                                                                                                                          
    }                                                                                                                                                                                                                                                                           
}                                                                                                                                                                                                                                                                               
@vonstring vonstring changed the title TV2 extractor fails for most/all recent videos [tv2] TV2 extractor fails for most/all recent videos Oct 21, 2019
@dstftw dstftw closed this in 9a621dd Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.