diff --git a/COPYING b/COPYING index eec88ff..c4ff845 100644 --- a/COPYING +++ b/COPYING @@ -1,6 +1,6 @@ Apache License Version 2.0, January 2004 -http://www.apache.org/licenses/ +https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION diff --git a/pylast/__init__.py b/pylast/__init__.py index 3d1a219..1dc7547 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -830,7 +830,7 @@ class _Request(object): try: conn.request( - method='POST', url="http://" + HOST_NAME + HOST_SUBDIR, + method='POST', url="https://" + HOST_NAME + HOST_SUBDIR, body=data, headers=headers) except Exception as e: raise NetworkError(self.network, e) @@ -2483,7 +2483,7 @@ class _Search(_BaseObject): doc = self._request(self._ws_prefix + ".search", True) - return _extract(doc, "opensearch:totalResults") + return _extract(doc, "totalResults") def _retrieve_page(self, page_index): """Returns the node of matches to be processed""" diff --git a/tests/test_pylast_artist.py b/tests/test_pylast_artist.py index 0d45f64..66dbb49 100755 --- a/tests/test_pylast_artist.py +++ b/tests/test_pylast_artist.py @@ -213,7 +213,7 @@ class TestPyLastArtist(PyLastTestCase): name_cap = artist1.get_name(properly_capitalized=True) # Assert - self.assertIn("http", image) + self.assertIn("https", image) self.assertGreater(playcount, 1) self.assertTrue(artist1 != artist2) self.assertEqual(name.lower(), name_cap.lower()) diff --git a/tests/test_pylast_network.py b/tests/test_pylast_network.py index 733a80e..2906b92 100755 --- a/tests/test_pylast_network.py +++ b/tests/test_pylast_network.py @@ -339,6 +339,18 @@ class TestPyLastNetwork(PyLastTestCase): self.assertIsInstance(results, list) self.assertIsInstance(results[0], pylast.Track) + def test_search_get_total_result_count(self): + # Arrange + artist = "Nirvana" + track = "Smells Like Teen Spirit" + search = self.network.search_for_track(artist, track) + + # Act + total = search.get_total_result_count() + + # Assert + self.assertGreater(int(total), 10000) + if __name__ == '__main__': unittest.main(failfast=True)