Skip to content

Commit

Permalink
[facebook] remove hardcoded chrome user-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
remitamine authored and ThirumalaiK committed Jan 28, 2021
1 parent 4279c1a commit 2a7909c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions youtube_dl/extractor/facebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ class FacebookIE(InfoExtractor):
_NETRC_MACHINE = 'facebook'
IE_NAME = 'facebook'

_CHROME_USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36'

_VIDEO_PAGE_TEMPLATE = 'https://www.facebook.com/video/video.php?v=%s'
_VIDEO_PAGE_TAHOE_TEMPLATE = 'https://www.facebook.com/video/tahoe/async/%s/?chain=true&isvideo=true&payloadtype=primary'

Expand Down Expand Up @@ -306,9 +304,7 @@ def _real_initialize(self):
self._login()

def _extract_from_url(self, url, video_id, fatal_if_no_video=True):
req = sanitized_Request(url)
req.add_header('User-Agent', self._CHROME_USER_AGENT)
webpage = self._download_webpage(req, video_id)
webpage = self._download_webpage(url, video_id)

video_data = None

Expand Down

0 comments on commit 2a7909c

Please sign in to comment.