kopia lustrzana https://github.com/bellingcat/auto-archiver
				
				
				
			Merge pull request #259 from bellingcat/fix_youtube_generic
Small fix for generic_extractor.py for general/ youtube extraction.pull/263/head
						commit
						90932a7bc8
					
				|  | @ -203,7 +203,7 @@ class GenericExtractor(Extractor): | |||
|         if not result.get("url"): | ||||
|             result.set_url(url) | ||||
| 
 | ||||
|         if "description" in video_data and not result.get_content(): | ||||
|         if "description" in video_data and not result.get("content"): | ||||
|             result.set_content(video_data["description"]) | ||||
|         # extract comments if enabled | ||||
|         if self.comments: | ||||
|  | @ -220,10 +220,13 @@ class GenericExtractor(Extractor): | |||
|             ) | ||||
| 
 | ||||
|         # then add the common metadata | ||||
|         if timestamp := video_data.pop("timestamp", None) and not result.get("timestamp"): | ||||
|         timestamp = video_data.pop("timestamp", None) | ||||
|         if timestamp and not result.get("timestamp"): | ||||
|             timestamp = datetime.datetime.fromtimestamp(timestamp, tz=datetime.timezone.utc).isoformat() | ||||
|             result.set_timestamp(timestamp) | ||||
|         if upload_date := video_data.pop("upload_date", None) and not result.get("upload_date"): | ||||
| 
 | ||||
|         upload_date = video_data.pop("upload_date", None) | ||||
|         if upload_date and not result.get("upload_date"): | ||||
|             upload_date = get_datetime_from_str(upload_date, "%Y%m%d").replace(tzinfo=datetime.timezone.utc) | ||||
|             result.set("upload_date", upload_date) | ||||
| 
 | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Erin Clark
						Erin Clark