Skip to content

Commit

Permalink
- Reduce columnIndex to max of colums (can happen with incorrect cols…
Browse files Browse the repository at this point in the history
…pan)

- Adds support for new format, added tests
  • Loading branch information
KoalaBear84 committed Aug 3, 2021
1 parent 849cead commit c98494e
Show file tree
Hide file tree
Showing 4 changed files with 1,411 additions and 9 deletions.
29 changes: 21 additions & 8 deletions src/OpenDirectoryDownloader.Tests/DirectoryParser101_125Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ public async Task TestDirectoryListing117bAsync()
}

/// <summary>
/// Url: view-source:http://107.189.4.168/
/// Url: http://107.189.4.168/
/// </summary>
[Fact]
public async Task TestDirectoryListing118aAsync()
Expand All @@ -482,19 +482,32 @@ public async Task TestDirectoryListing118aAsync()
}

/// <summary>
/// Url: view-source:http://107.189.4.168/6400/%E6%B8%B8%E6%88%8F/
/// Url: http://107.189.4.168/6400/%E6%B8%B8%E6%88%8F/
/// </summary>
[Fact]
public async Task TestDirectoryListing118bAsync()
public async Task TestDirectoryListing119aAsync()
{
WebDirectory webDirectory = await ParseHtml(GetSample());

Assert.Equal("ROOT", webDirectory.Name);
Assert.Equal(2, webDirectory.Subdirectories.Count);
Assert.Equal("宿星Girlfriend", webDirectory.Subdirectories[0].Name);
Assert.Equal(4, webDirectory.Files.Count);
Assert.Equal("千之刃涛,桃花染之皇姬 -柳暗花明-.zip", webDirectory.Files[0].FileName);
Assert.Equal(5583457485, webDirectory.Files[0].FileSize);
Assert.Equal(21, webDirectory.Subdirectories.Count);
Assert.Equal("100 Greatest 90s Pop Classics (2020)", webDirectory.Subdirectories[0].Name);
Assert.Empty(webDirectory.Files);
}

/// <summary>
/// Url: https://home.agstm.ro/music/
/// </summary>
[Fact]
public async Task TestDirectoryListing119bAsync()
{
WebDirectory webDirectory = await ParseHtml(GetSample());

Assert.Equal("ROOT", webDirectory.Name);
Assert.Empty(webDirectory.Subdirectories);
Assert.Equal(102, webDirectory.Files.Count);
Assert.Equal("001. Britney Spears - ...Baby One More Time.mp3", webDirectory.Files[0].FileName);
Assert.Equal(8524923, webDirectory.Files[0].FileSize);
}
}
}
Loading

0 comments on commit c98494e

Please sign in to comment.