Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Freesound] Unable to extract music title #11602

Closed
ghost opened this issue Jan 4, 2017 · 1 comment
Closed

[Freesound] Unable to extract music title #11602

ghost opened this issue Jan 4, 2017 · 1 comment

Comments

@ghost
Copy link

@ghost ghost commented Jan 4, 2017

  • I've verified and I assure that I'm running youtube-dl 2017.01.02

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other
ERROR: Unable to extract music title; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 694, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 359, in extract
    return self._real_extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/freesound.py", line 28, in _real_extract
    webpage, 'music title', flags=re.DOTALL)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 671, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 662, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract music title; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

http://www.freesound.org/people/miklovan/sounds/194503/

@shizeeg
Copy link
Contributor

@shizeeg shizeeg commented Jan 4, 2017

a quick fix:

diff --git a/youtube_dl/extractor/freesound.py b/youtube_dl/extractor/freesound.py
index 5ff62af2a..65b2fd27d 100644
--- a/youtube_dl/extractor/freesound.py
+++ b/youtube_dl/extractor/freesound.py
@@ -23,9 +23,7 @@ class FreesoundIE(InfoExtractor):
         mobj = re.match(self._VALID_URL, url)
         music_id = mobj.group('id')
         webpage = self._download_webpage(url, music_id)
-        title = self._html_search_regex(
-            r'<div id="single_sample_header">.*?<a href="#">(.+?)</a>',
-            webpage, 'music title', flags=re.DOTALL)
+        title = self._og_search_property('audio:title', webpage, 'song title')
         description = self._html_search_regex(
             r'<div id="sound_description">(.*?)</div>', webpage, 'description',
             fatal=False, flags=re.DOTALL)
@dstftw dstftw closed this in ed06da4 Jan 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.