Set default headers

This commit is contained in:
Hoang Hong Quan
2025-01-06 07:51:32 +07:00
parent 0e289bb76c
commit 42a4223020
3 changed files with 6 additions and 10 deletions

View File

@@ -5,10 +5,7 @@ import random
class Github:
def __init__(self):
self.utils = utils.Utils()
self.headers = {
"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
}
self.fetcher = resource_fetcher.ResourceFetcher(self.headers)
self.fetcher = resource_fetcher.ResourceFetcher()
def get_latest_commit(self, owner, repo, branch="main"):
url = "https://github.com/{}/{}/commits/{}".format(owner, repo, branch)