Repository: InstaPy/InstaPy

Issue:
set_smart_location_hashtags crashes
set_smart_location_hashtags crashes when using the code in the tutorial

![image](https://user-images.githubusercontent.com/4077233/109371752-04331a80-78af-11eb-8a7a-74bf28f2c935.png)

Throws an error
```
---------------------------------------------------------------------------
JSONDecodeError                           Traceback (most recent call last)
<ipython-input-18-71f011c24cbe> in <module>
      1 # session.set_smart_hashtags(['cycling', 'roadbike'], limit=3, sort='top', log_tags=True)
      2 
----> 3 session.set_smart_location_hashtags(['204517928/chicago-illinois', '213570652/nagoya-shi-aichi-japan'], radius=20, limit=10)
      4 session.like_by_tags(['soccer', 'cr7', 'neymar'], amount=10, use_smart_location_hashtags=True)
      5 

/usr/local/lib/python3.8/site-packages/instapy/instapy.py in set_smart_location_hashtags(self, locations, radius, limit, log_tags)
    784 
    785             req = requests.get(url)
--> 786             data = json.loads(req.text)
    787             if int(data["count"]) == 0:
    788                 self.logger.warning("Too few results for {} location".format(location))

/usr/local/lib/python3.8/json/__init__.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    355             parse_int is None and parse_float is None and
    356             parse_constant is None and object_pairs_hook is None and not kw):
--> 357         return _default_decoder.decode(s)
    358     if cls is None:
    359         cls = JSONDecoder

/usr/local/lib/python3.8/json/decoder.py in decode(self, s, _w)
    335 
    336         """
--> 337         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    338         end = _w(s, end).end()
    339         if end != len(s):

/usr/local/lib/python3.8/json/decoder.py in raw_decode(self, s, idx)
    353             obj, end = self.scan_once(s, idx)
    354         except StopIteration as err:
--> 355             raise JSONDecodeError("Expecting value", s, err.value) from None
    356         return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)



[6]

```





Discussion:

Resolving patch:
diff --git a/instapy/instapy.py b/instapy/instapy.py
--- a/instapy/instapy.py
+++ b/instapy/instapy.py
@@ -774,7 +774,7 @@ def set_smart_hashtags(
     def set_smart_location_hashtags(
         self, locations: list, radius: int = 10, limit: int = 3, log_tags: bool = True
     ):
-        """Generate smart hashtags based on https://displaypurposes.com/map"""
+        """Generate smart hashtags based on https://apidisplaypurposes.com/map"""
         if locations is None:
             self.logger.error("set_smart_location_hashtags is misconfigured")
             return self
@@ -792,7 +792,7 @@ def set_smart_location_hashtags(
                 bbox["lat_max"],
                 radius,
             )
-            url = "https://displaypurposes.com/local/?bbox={}".format(bbox_url)
+            url = "https://apidisplaypurposes.com/local/?bbox={}".format(bbox_url)
 
             req = requests.get(url)
             data = json.loads(req.text)


Test patch: