File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public class GribDownloader
1717 /// <exception cref="Exception"></exception>
1818 public void DownloadGribFile ( string filePath )
1919 {
20- var x = LastestDataSetFinder . Find ( ) ;
20+ var x = LastestDataSetFinder . Find ( HomePageUrl ) ;
2121 webPageUrl = x . Url ;
2222 webPageSrc = x . Source ;
2323
Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ public static class LastestDataSetFinder
1111 // it's considered a valid page to return.
1212 // (The source of filter page has about 30000 chars,
1313 // a page with file unavailable has only 700.)
14- private const int sourceCodeLenCriteria = 9000 ;
14+ private const int sourceCodeLenCriteria = 1000 ;
1515
1616 // @Throws
17- public static FindResult Find ( )
17+ public static FindResult Find ( string PageUrl )
1818 {
1919 using ( var client = WebClientNoCache ( ) )
2020 {
21- var mainPageSource = client . DownloadString ( GribDownloader . HomePageUrl ) ;
21+ var mainPageSource = client . DownloadString ( PageUrl ) ;
2222 var urls = GetUrls ( mainPageSource ) ;
2323
2424 foreach ( var i in urls )
@@ -27,10 +27,14 @@ public static FindResult Find()
2727 {
2828 var src = client . DownloadString ( i ) ;
2929
30- if ( src . Length >= sourceCodeLenCriteria )
30+ if ( src . Length >= sourceCodeLenCriteria * 10 )
3131 {
3232 return new FindResult ( ) { Url = i , Source = src } ;
3333 }
34+ if ( src . Length >= sourceCodeLenCriteria )
35+ {
36+ return LastestDataSetFinder . Find ( i ) ;
37+ }
3438 }
3539 catch { }
3640 }
You can’t perform that action at this time.
0 commit comments