0

I am trying to download a video from an .mpd file and I'm getting the following error:

ValueError: invalid literal for int() with base 10: '7766645.83333'

When I look in the .mpd file, it has these <S> elements, some of them containing the float.

<S t="636000000" d="6000000"/>
<S t="642000000" d="6000000"/>
<S t="648000000" d="7766645.83333"/>

The program seems to have a problem with d being a float. However if the segments are displayed like so:

<SegmentURL media="segment-1.m4s"/>
<SegmentURL media="segment-2.m4s"/>
<SegmentURL media="segment-3.m4s"/>

Then there is no issue. Is there a workaround for this? Is there a way I can convert this .mpd file to a format that youtube-dl can handle. I am currently using the 2018.06.25 version of youtube-dl.

Robert Calove
  • 449
  • 2
  • 9
  • Which URL are you downloading? This should just be fixed in youtube-dl, but neither I nor anybody else can realistically do so without being able to reproduce the problem. – phihag Jun 30 '18 at 08:00
  • Hey I'm facing the same issue have you found a solution ? – Safwen Daghsen Feb 23 '20 at 11:35

1 Answers1

0

Read the backtrace when the error happens. You'll notice it points you to source code /usr/lib/python3.6/site-packages/youtube_dl/extractor/common.py, or something similar. When you open that file:line, you'll see something like

't': int(s.get('t', 0)),
 # @d is mandatory (see [1, 5.3.9.6.2, Table 17, page 60])
'd': int(s.attrib['d']),
'r': r,

Change the 2 int to float seems to solve the problem temporarily.

Yu Zhou
  • 788
  • 6
  • 11