protected override void parseAlbum() { //find navigateLinks _tableFound = tableParser.FindTable("<table width=\"100%\" cellpadding=\"5\" cellspacing=\"0\"></tr><tr><td width="); if (_tableFound == null) { _tableFound = tableParser.FindTable("<table width=\"100%\" cellpadding=\"5\" cellspacing=\"0\"></tr><tr><td width="); } if (_tableFound != null) { getLinksFromTableAlbum(_tableFound); pagefound = true; currentPageType = PageType.Album; } _tableFound = null; //find playlinks _tableFound = tableParser.FindTable("<form name=\"albumForm\""); if (_tableFound != null) { getPlayLinksFromTableAlbum(); } _tableFound = null; }
protected override void parseGenerenOrInterpret() { _tableFound = tableParser.FindTable("<table width=\"100%\" cellspacing=\"0\">"); if (_tableFound != null) { for (int i = 0; i < _tableFound.SubTables.Count; i++) { if (_tableFound.SubTables[i].TableContent.StartsWith("<table width=\"100%\" cellspacing=\"0\">") && _tableFound.SubTables[i].TableContent.Contains("<tr>") && _tableFound.SubTables[i].TableContent.Contains("<td valign=\"top\">") && _tableFound.SubTables[i].TableContent.Contains("<nobr>")) { getLinksFromTableGenrenInterpret(i); } } pagefound = true; currentPageType = PageType.Genren; } _tableFound = null; }
private void getLinksFromTableTracks(Table table) { MatchCollection allMatchResults = null; try { Regex regexObj = new Regex("<a href=\"([^>]*(?<navigateLink>index[^>]*(m3u|xspf|asx|pls))[^>]*\") title=\"(?<name>[^>]*)\" alt[^>]*>[^>]*</a>", RegexOptions.Singleline | RegexOptions.IgnoreCase); allMatchResults = regexObj.Matches(_tableFound.TableContent); } catch (ArgumentException ex) { throw ex; } if (allMatchResults.Count > 0) { for (int t = 0; t < allMatchResults.Count; t++) { Match match = allMatchResults[t]; string playlink = match.Groups["navigateLink"].ToString(); string name = match.Groups["name"].ToString(); //urlContent = match.Groups["NavigateLink"].ToString(); LinkClass link = new LinkClass(string.Empty, name, playlink, string.Empty); linkListe.Add(link); } } }
private void getLinksFromSearchTable(Table _tableFound) { for (int i = 0; i < _tableFound.SubTables.Count; i++) { MatchCollection allMatchResults = null; try { Regex regexObj = new Regex("/ <a href=\"/[^>]*(?<PlayLink>index[^>]*mp3[^>]*)\"[^>]*title=\"(?<Name>[^>]*)\" alt=\"[^>]*class=\"jz_track_table_songs_href\".*?</a>", RegexOptions.Singleline | RegexOptions.IgnoreCase); allMatchResults = regexObj.Matches(_tableFound.SubTables[i].TableContent); if (allMatchResults.Count > 0) { for (int t = 0; t < allMatchResults.Count; t++) { Match match = allMatchResults[t]; string playlink = match.Groups["PlayLink"].ToString(); string name = match.Groups["Name"].ToString(); //urlContent = match.Groups["NavigateLink"].ToString(); LinkClass link = new LinkClass(string.Empty, name, playlink, string.Empty); linkListe.Add(link); } } } catch (ArgumentException ex) { throw ex; } } }
private void getLinksFromTableAlbum(Table table) { string name = null; string urlContent = null; MatchCollection allMatchResults = null; try { Regex regexObj = new Regex("<a href=\"[^>]*(?<navigateLink>index[^>]*)\" title=\"(?<name>[^>]*)\" alt[^>]*>[^>]*<img src=\"(?<imgLink>[^>]*jpg)\".*?</a>", RegexOptions.Singleline | RegexOptions.IgnoreCase); allMatchResults = regexObj.Matches(table.TableContent); } catch (ArgumentException ex) { throw ex; } if (allMatchResults.Count > 0) { for (int t = 0; t < allMatchResults.Count; t++) { Match match = allMatchResults[t]; name = match.Groups["name"].ToString(); urlContent = match.Groups["navigateLink"].ToString(); string imgLink = match.Groups["imgLink"].ToString(); LinkClass link = new LinkClass(urlContent, name, string.Empty, imgLink); linkListe.Add(link); _dicLinkliste.Add(name, link); } } }
protected override void parseTracks() { _tableFound = tableParser.FindTable("<table class=\"jz_track_table\" width=\"100%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">"); if (_tableFound != null) { if (_tableFound.TableContent.StartsWith("<table class=\"jz_track_table\" width=\"100%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">")) { getLinksFromTableTracks(_tableFound); } if (linkListe.Count != 0) { pagefound = true; currentPageType = PageType.Track; } } _tableFound = null; }
protected override void parseSearchPage() { _tableFound = tableParser.FindTable("<table width=\"100%\" cellspacing=\"0\" cellpadding=\"2\"><tr><td colspan=\"4\" class=\"jz_block_td\">"); if (linkListe.Count == 0) { getLinksFromSearchTable(_tableFound); } if (linkListe.Count != 0) { pagefound = true; currentPageType = PageType.Track; } }
/// <summary> /// Search all tables and subtables for tableContent /// </summary> /// <param name="table">table to search subtables</param> /// <param name="tableContent">content of the table to find</param> private void readTableToString(Table table, string tableContent) { for (int t = 0; t < table.SubTables.Count; t++) { if (!table.SubTables[t].TableContent.Contains(tableContent)) { readTableToString(table.SubTables[t], tableContent); } if (table.SubTables[t].TableContent.Contains(tableContent)) { _tableFound = table.SubTables[t]; } } }
private void onOpenTagFound(string[] words, int i) { Table table = new Table(); if (_CurrentTable != null) { _lastUsedTable = null; _lastUsedTable = _CurrentTable; } _CurrentTable = null; _CurrentTable = table; table.TopTable = _lastUsedTable; if (_topTable == null) { _topTable = table; _tableList.Add(table); _lastUsedTable = _topTable; } int i_vorTable = words[i].IndexOf("<table"); string vorTable = words[i].Substring(0, i_vorTable); string nachTable = words[i].Substring(i_vorTable, words[i].Length - i_vorTable); table.TableContent = table.TableContent + nachTable; if (table != _topTable) { _lastUsedTable.SubTables.Add(table); } _CurrentTable.wordsAdded = true; }
private void onCloseTagFound(string[] words, int i) { int i_vorTableClose = words[i].IndexOf("</table>"); string vorTableClose = words[i].Substring(0, i_vorTableClose + 8); string nachTableClose = words[i].Substring(i_vorTableClose + 8, words[i].Length - (i_vorTableClose + 8)); _CurrentTable.TableContent += vorTableClose; _CurrentTable.TableClosed = true; _CurrentTable.wordsAdded = true; _CurrentTable = _CurrentTable.TopTable; }