File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed
YouTubeLiveSitePlugin/Test2 Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -43,19 +43,26 @@ private static dynamic GetVideosTab(dynamic ytInitialData)
43
43
}
44
44
private static ListType GetType ( string ytInitialData )
45
45
{
46
- dynamic d = JsonConvert . DeserializeObject ( ytInitialData ) ;
47
- var videoTab = GetVideosTab ( d ) ;
48
- var arr = videoTab . tabRenderer . content . sectionListRenderer . subMenu . channelSubMenuRenderer . contentTypeSubMenuItems ;
49
- foreach ( var item in arr )
46
+ try
50
47
{
51
- var title = ( string ) item . title ;
52
- var selected = ( bool ) item . selected ;
53
- if ( selected )
48
+ dynamic d = JsonConvert . DeserializeObject ( ytInitialData ) ;
49
+ var videoTab = GetVideosTab ( d ) ;
50
+ var arr = videoTab . tabRenderer . content . sectionListRenderer . subMenu . channelSubMenuRenderer . contentTypeSubMenuItems ;
51
+ foreach ( var item in arr )
54
52
{
55
- var type = GetTypeByName ( title ) ;
56
- return type ;
53
+ var title = ( string ) item . title ;
54
+ var selected = ( bool ) item . selected ;
55
+ if ( selected )
56
+ {
57
+ var type = GetTypeByName ( title ) ;
58
+ return type ;
59
+ }
57
60
}
58
61
}
62
+ catch ( Exception ex )
63
+ {
64
+ throw new ParseException ( ytInitialData , ex ) ;
65
+ }
59
66
return ListType . Unknown ;
60
67
}
61
68
private static ListType GetTypeByName ( string listTypeName )
You can’t perform that action at this time.
0 commit comments