Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add support for trilulilu.ro:audio tracks #4068
Comments
|
I've looked into it, in order to get the |
|
@naglis If you need a starting point, I have a partially implemented AMF 0 reader: import io
from youtube_dl.utils import struct_unpack
class AmfReader(io.BytesIO):
# Utility functions for reading numbers and strings
def read_unsigned_long_long(self):
return struct_unpack('!Q', self.read(8))[0]
def read_double(self):
return struct_unpack('!d', self.read(8))[0]
def read_unsigned_int(self):
return struct_unpack('!I', self.read(4))[0]
def read_unsigned_short(self):
return struct_unpack('!H', self.read(2))[0]
def read_unsigned_char(self):
return struct_unpack('!B', self.read(1))[0]
def read_amf_string(self):
length = self.read_unsigned_short()
return self.read(length)
def read_amf_value(self):
value_type = self.read_unsigned_char()
if value_type == 0: # Double
return self.read_double()
if value_type == 2: # DataString
return self.read_amf_string()
elif value_type == 3: # DataObject
data_object = {}
while True:
marker = tuple(map(lambda _: self.read_unsigned_char(), range(3)))
if marker == (0, 0, 9):
break
self.seek(-3, io.SEEK_CUR)
name = self.read_amf_string()
data = self.read_amf_value()
data_object[name] = data
return data_object
else:
raise NotImplementedError('Unsupported type %s' % value_type)
# From https://en.wikipedia.org/wiki/Action_Message_Format#AMF0
r = ' 03 00 04 6e 61 6d 65 02 00 04 4d 69 6b 65 00 03 61 67 65 00 40 3e 00 00 00 00 00 00 00 05 61 6c 69 61 73 02 00 04 4d 69 6b 65 00 00 09'
b = eval('b"""' + r.replace(' ', '\\x') + '"""')
reader = AmfReader(b)
print(reader.read_amf_value()) |
|
Thanks @jaimeMF, I will definitely check it out. |
|
Hi, This issue has been solved.Try the following command : Please make sure ffmpeg is install on your system. If not please follow the instructions given here |
Please try to add support for audio tracks on trilulilu,.ro
Audio category url on trilulilu.ro is http://www.trilulilu.ro/?mimetype=audio#ref=mimetype_filter_audio
Example of audio only url from trilulilu.ro: http://www.trilulilu.ro/muzica-rock/freddie-mercury-the-great-pretender-1#ref=home
youtube-dl output with --verbose parameter:
D:\Tools>youtube-dl.exe --ve
rbose http://www.trilulilu.ro/muzica-rock/freddie-mercury-the-great-pretender-1#
ref=home
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'http://www.trilulilu.ro/muzica-rock/fr
eddie-mercury-the-great-pretender-1#ref=home']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2014.10.30
[debug] Python version 2.7.8 - Windows-8-6.2.9200
[debug] exe versions: ffmpeg N-66521-
[debug] Proxy map: {}
[generic] freddie-mercury-the-great-pretender-1#ref=home: Requesting header
WARNING: Falling back on generic information extractor.
[generic] freddie-mercury-the-great-pretender-1#ref=home: Downloading webpage
[generic] freddie-mercury-the-great-pretender-1#ref=home: Extracting information
ERROR: Unsupported URL: http://www.trilulilu.ro/muzica-rock/freddie-mercury-the-
great-pretender-1#ref=home; please report this issue on https://yt-dl.org/bug .
Be sure to call youtube-dl with the --verbose flag and include its complete outp
ut. Make sure you are using the latest version; type youtube-dl -U to update.
Traceback (most recent call last):
File "youtube_dl\extractor\generic.pyo", line 581, in _real_extract
File "youtube_dl\utils.pyo", line 1629, in parse_xml
File "xml\etree\ElementTree.pyo", line 1300, in XML
File "xml\etree\ElementTree.pyo", line 1642, in feed
File "xml\etree\ElementTree.pyo", line 1506, in _raiseerror
ParseError: syntax error: line 1, column 0
Traceback (most recent call last):
File "youtube_dl\YoutubeDL.pyo", line 533, in extract_info
File "youtube_dl\extractor\common.pyo", line 198, in extract
File "youtube_dl\extractor\generic.pyo", line 962, in _real_extract
ExtractorError: Unsupported URL: http://www.trilulilu.ro/muzica-rock/freddie-mer
cury-the-great-pretender-1#ref=home; please report this issue on https://yt-dl.o
rg/bug . Be sure to call youtube-dl with the --verbose flag and include its comp
lete output. Make sure you are using the latest version; type youtube-dl -U to
update.