Skip to content

Commit

Permalink
mangadex.org: Added user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
HDoujinDownloader authored Mar 9, 2024
1 parent d2a28a8 commit 9509e12
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions modules/lua/MangaDex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,24 +217,26 @@ function GetPages()
pages.Referer = 'https://' .. module.Domain .. '/'

if(API_VERSION >= 20230612) then

pages.Headers['Accept'] = '*/*'
pages.Headers['Origin'] = 'https://' .. module.Domain

PrepareHttpHeaders(pages)
end

end

function GetGalleryUuid()

return url:regex('\\/(?:title|chapter)\\/([^\\/?#]+)', 1)

end

function PrepareHttpHeaders()
function PrepareHttpHeaders(obj)

http.Headers['Accept'] = '*/*'
http.Headers['Origin'] = 'https://' .. module.Domain
obj = obj or http

obj.Headers['Accept'] = '*/*'
obj.Headers['Origin'] = 'https://' .. module.Domain
obj.Headers['Referer'] = 'https://' .. module.Domain .. '/'

if(API_VERSION > 20230927) then
obj.Headers['User-Agent'] = API_CLIENT
end

end

Expand Down

0 comments on commit 9509e12

Please sign in to comment.