lci.py 1.3 KB

1234567891011121314151617181920212223242526272829
  1. from .common import InfoExtractor
  2. class LCIIE(InfoExtractor):
  3. _VALID_URL = r'https?://(?:www\.)?(?:lci|tf1info)\.fr/[^/]+/[\w-]+-(?P<id>\d+)\.html'
  4. _TESTS = [{
  5. 'url': 'https://www.tf1info.fr/politique/election-presidentielle-2022-second-tour-j-2-marine-le-pen-et-emmanuel-macron-en-interview-de-lci-vendredi-soir-2217486.html',
  6. 'info_dict': {
  7. 'id': '13875948',
  8. 'ext': 'mp4',
  9. 'title': 'md5:660df5481fd418bc3bbb0d070e6fdb5a',
  10. 'thumbnail': 'https://photos.tf1.fr/1280/720/presidentielle-2022-marine-le-pen-et-emmanuel-macron-invites-de-lci-ce-vendredi-9c0e73-e1a036-0@1x.jpg',
  11. 'upload_date': '20220422',
  12. 'duration': 33,
  13. },
  14. 'params': {
  15. 'skip_download': True,
  16. },
  17. }, {
  18. 'url': 'https://www.lci.fr/politique/election-presidentielle-2022-second-tour-j-2-marine-le-pen-et-emmanuel-macron-en-interview-de-lci-vendredi-soir-2217486.html',
  19. 'only_matching': True,
  20. }]
  21. def _real_extract(self, url):
  22. video_id = self._match_id(url)
  23. webpage = self._download_webpage(url, video_id)
  24. wat_id = self._search_regex(r'watId["\']?\s*:\s*["\']?(\d+)', webpage, 'wat id')
  25. return self.url_result('wat:' + wat_id, 'Wat', wat_id)