Module:XVideosRedList: Difference between revisions
Content deleted Content added
PeaceDeadC (talk | contribs) No edit summary |
PeaceDeadC (talk | contribs) No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
Line 8:
local BASE_URL = "https://www.xvideos.red/"
-- Suffix to append to all XVideos RED URLs
local URL_SUFFIX = "?sxcaf=TARTFSJC35
-- Tab suffix added after the main suffix
local TAB_SUFFIX = "#_tabRed"
-- Main header URL for title link
local HEADER_URL = "https://www.xvideos.red/gay?sxcaf=TARTFSJC35"
Line 124 ⟶ 126:
end
-- Function to format country flag using
-- @param country string: The country code or name
-- @param frame table: The current frame object for template expansion
-- @return string: Formatted country flag or empty string if country is nil or empty
local function formatCountryFlag(country, frame)
if not country or country == "" then
return ""
end
-- Use frame:expandTemplate to process the flagicon template
local flagTemplate = frame:expandTemplate{
title = 'flagicon',
args = { country }
}
return flagTemplate .. ' '
end
Line 206 ⟶ 215:
local channelUrl = ""
local channelDisplay = channel.name
local countryFlag = formatCountryFlag(channel.country, frame)
if channel.channel and channel.channel ~= '' then
channelUrl = BASE_URL .. channel.channel .. URL_SUFFIX .. TAB_SUFFIX
channelDisplay = string.format('%s[%s %s]', countryFlag, channelUrl, channel.name)
end
| |||