{"record":{"id":"7cb61583ba583933","repo":"ytdl-org/youtube-dl","slug":"date-range-s-the-start-date-must-be-before-t","errorCode":null,"errorMessage":"Date range: \"%s\" , the start date must be before the end date","messagePattern":"Date range: \"(.+?)\" , the start date must be before the end date","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"youtube_dl/utils.py","lineNumber":3339,"sourceCode":"    else:\n        return date_str\n\n\nclass DateRange(object):\n    \"\"\"Represents a time interval between two dates\"\"\"\n\n    def __init__(self, start=None, end=None):\n        \"\"\"start and end must be strings in the format accepted by date\"\"\"\n        if start is not None:\n            self.start = date_from_str(start)\n        else:\n            self.start = datetime.datetime.min.date()\n        if end is not None:\n            self.end = date_from_str(end)\n        else:\n            self.end = datetime.datetime.max.date()\n        if self.start > self.end:\n            raise ValueError('Date range: \"%s\" , the start date must be before the end date' % self)\n\n    @classmethod\n    def day(cls, day):\n        \"\"\"Returns a range that only contains the given day\"\"\"\n        return cls(day, day)\n\n    def __contains__(self, date):\n        \"\"\"Check if the date is in the range\"\"\"\n        if not isinstance(date, datetime.date):\n            date = date_from_str(date)\n        return self.start <= date <= self.end\n\n    def __str__(self):\n        return '%s - %s' % (self.start.isoformat(), self.end.isoformat())\n\n    def __eq__(self, other):\n        return (isinstance(other, DateRange)\n                and self.start == other.start and self.end == other.end)","sourceCodeStart":3321,"sourceCodeEnd":3357,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/utils.py#L3321-L3357","documentation":"Error \"Date range: \"%s\" , the start date must be before the end date\" thrown in ytdl-org/youtube-dl.","triggerScenarios":"Thrown at youtube_dl/utils.py:3339 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the --date range so the start date is before the end date."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}