Skip to content

Commit

Permalink
Fix parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedon-dev committed Aug 10, 2024
1 parent 23ca6a7 commit 0964356
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/plugins/official_plugins/xhamster.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,17 @@ class XHamsterPlugin extends PluginBase implements PluginInterface {

// convert the divs into UniversalSearchResults
if (resultsList == null) {
logger.w("No results found");
return [];
}
List<UniversalSearchResult> results = [];
for (Element resultDiv in resultsList) {
try {
// Only select the divs with <div class="thumb-list__item video-thumb"
if (resultDiv.attributes['class']?.trim() ==
"thumb-list__item video-thumb") {
if (resultDiv.attributes['class'] == null) {
continue;
}
// Only select the thumbnail divs
if (resultDiv.attributes['class']!.trim().startsWith("thumb-list__item video-thumb")) {
// each result has 2 sub-divs
List<Element>? subElements = resultDiv.children;
String? author = subElements[1]
Expand Down

0 comments on commit 0964356

Please sign in to comment.