Skip to content

Commit 7bed3d3

Browse files
committed
Fix forvo scraper
1 parent b07b406 commit 7bed3d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

interface/forvo.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ end
165165
local function extract_pronunciations(menu, word, callback)
166166
local word_url = "https://forvo.com/word/" .. url.encode(word) .. "/"
167167
return html_request(word_url, function(html)
168-
local start_pat = [[pronunciation in%s*<a href="https://forvo%.com/languages/]] .. cfg.values.forvo_language .. [[/">]]
169-
local end_pat = [[<div class="more_actions">]]
170-
local audio_pat = [[onclick="Play%((%d+),'([^']*)','([^']*)',([^,]*),'([^']*)','([^']*)','(.)'%);return false;"]]
168+
local start_pat = [[<article class="pronunciations" id="language%-]] .. cfg.values.forvo_language .. [[" >]]
169+
local end_pat = [[<article class="pronunciations" id="word%-extra%-info]]
170+
local audio_pat = [[onclick="Play%((%d+),'([^']*)','([^']*)',([^,]*),'([^']*)','([^']*)','(.)','[^']*','[^']*'%);return false;"]]
171171
local user_prefix_pat = "Pronunciation by%s+"
172172
local user_pat = [[^<span class="ofLink" data%-p1="[^"]+" data%-p2="([^"]+)" >]]
173173
local user_pat_no_link = "^(%S+)"

0 commit comments

Comments
 (0)