Skip to content

Commit

Permalink
Affichage d'un message d'erreur pour les vidéos JVC intégrées.
Browse files Browse the repository at this point in the history
  • Loading branch information
FranckRJ committed Jan 15, 2018
1 parent 69d2b19 commit 81d958a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions java/com/franckrj/respawnirc/utils/JVCParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public final class JVCParser {
private static final Pattern longLinkPattern = Pattern.compile("<span class=\"JvCare [^\"]*\"[^i]*itle=\"([^\"]*)\">[^<]*<i></i><span>[^<]*</span>[^<]*</span>");
private static final Pattern smileyPattern = Pattern.compile("<img src=\"http(s)?://image\\.jeuxvideo\\.com/smileys_img/([^\"]*)\" alt=\"[^\"]*\" data-code=\"([^\"]*)\" title=\"[^\"]*\" [^>]*>");
private static final Pattern youtubeVideoPattern = Pattern.compile("<div class=\"player-contenu\"><div class=\"[^\"]*\"><iframe .*? src=\"http(s)?://www\\.youtube\\.com/embed/([^\"]*)\"[^>]*></iframe></div></div>");
private static final Pattern jvcVideoPattern = Pattern.compile("<div class=\"player-contenu\">.*?</div>[^<]*</div>[^<]*</div>[^<]*</div>", Pattern.DOTALL);
private static final Pattern surroundedBlockquotePattern = Pattern.compile("(<br /> *)*(<(/)?blockquote>)( *<br />)*");
private static final Pattern noelshackImagePattern = Pattern.compile("<span class=\"JvCare[^>]*><img class=\"img-shack\".*?src=\"http(s)?://([^\"]*)\" alt=\"([^\"]*)\"[^>]*></span>");
private static final Pattern emptySearchPattern = Pattern.compile("<span style=\"[^\"]*\">[ \\n\\r]*Aucune réponse pour votre recherche ![ \\n\\r]*</span>");
Expand Down Expand Up @@ -885,6 +886,7 @@ public static String parseMessageToPrettyMessage(String messageInString, Setting
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, smileyPattern, 2, "<img src=\"smiley_", "\"/>", null, null);

ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, youtubeVideoPattern, 2, "<a href=\"http://youtu.be/", "\">http://youtu.be/", 2, "</a>");
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, jvcVideoPattern, -1, "[[Vidéo non supportée par l'application]]", "", null, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, jvcLinkPattern, 1, "", "", makeLinkDependingOnSettingsAndForceMake, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, shortLinkPattern, 1, "", "", makeLinkDependingOnSettingsAndForceMake, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, longLinkPattern, 1, "", "", makeLinkDependingOnSettingsAndForceMake, null);
Expand Down Expand Up @@ -935,6 +937,7 @@ public static String parseMessageToSimpleMessage(String messageInString) {
ToolForParsing.replaceStringByAnother(messageInBuilder, "\n", "");
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, smileyPattern, 3, "", "", null, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, youtubeVideoPattern, 2, "http://youtu.be/", "", null, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, jvcVideoPattern, -1, "[[Vidéo non supportée par l'application]]", "", null, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, jvcLinkPattern, 1, "", "", null, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, shortLinkPattern, 1, "", "", null, null);
ToolForParsing.parseThisMessageWithThisPattern(messageInBuilder, longLinkPattern, 1, "", "", null, null);
Expand Down

0 comments on commit 81d958a

Please sign in to comment.