File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -313,16 +313,15 @@ fn parse_movie_article(content: &str) -> Option<Value> {
313313
314314fn extract_simple_content ( html : & str , class_marker : & str , end_tag : & str ) -> Option < String > {
315315 if let Some ( marker_pos) = html. find ( class_marker) {
316- let content_start = marker_pos + class_marker. len ( ) ;
317- // Skip > if we just searched for a class
318- let start = if html[ content_start..] . starts_with ( ">" ) {
319- content_start + 1
320- } else {
321- content_start
322- } ;
316+ let after_marker = marker_pos + class_marker. len ( ) ;
323317
324- if let Some ( end_pos) = html[ start..] . find ( end_tag) {
325- return Some ( html[ start..start + end_pos] . trim ( ) . to_string ( ) ) ;
318+ // Find the closing '>' of the current tag
319+ if let Some ( tag_end) = html[ after_marker..] . find ( '>' ) {
320+ let start = after_marker + tag_end + 1 ;
321+
322+ if let Some ( end_pos) = html[ start..] . find ( end_tag) {
323+ return Some ( html[ start..start + end_pos] . trim ( ) . to_string ( ) ) ;
324+ }
326325 }
327326 }
328327 None
Original file line number Diff line number Diff line change @@ -80,14 +80,15 @@ const StreamingManager = {
8080
8181 container . innerHTML = this . filteredMovies . map ( movie => {
8282 const searchUrl = `https://thpibay.site/search/${ encodeURIComponent ( movie . title ) } /1/99/0` ;
83+ const escapedTitle = movie . title . replace ( / " / g, '"' ) ;
8384
8485 return `
8586 <div class="movie-card">
8687 <span class="badge badge-lang">${ movie . language } </span>
8788 <span class="badge badge-quality">${ movie . quality } </span>
8889 <img src="${ movie . poster_url || '/static/images/no-poster.png' } "
8990 class="movie-poster"
90- alt="${ movie . title } "
91+ alt="${ escapedTitle } "
9192 onerror="this.src='/static/images/no-poster.png'"
9293 onclick="window.open('${ movie . url } ', '_blank')">
9394 <div class="movie-info">
You can’t perform that action at this time.
0 commit comments