prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Spider motel6 is broken
  During the global build at 2021-08-18-14-42-26, spider **motel6** failed with **0 features** and **2 errors**.
  
  Here's [the log](https://data.alltheplaces.xyz/runs/2021-08-18-14-42-26/logs/motel6.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-08-18-14-42-26/output/motel6.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-08-18-14-42-26/output/motel6.geojson))
  
  </issue>
  <code>
  [start of locations/spiders/motel6.py]
  1 # -*- coding: utf-8 -*-
  2 import scrapy
  3 import json
  4 from locations.items import GeojsonPointItem
  5 
  6 brand_lookup = {
  7     "MS": "Motel 6",
  8     "SS": "Studio 6",
  9     "HS": "Hotel 6"
  10 }
  11 
  12 
  13 class Motel6Spider(scrapy.Spider):
  14     name = "motel6"
  15     allowed_domains = ["motel6.com"]
  16     start_urls = (
  17         'https://www.motel6.com/var/g6/hotel-summary/ms.infinity.1.json',
  18     )
  19 
  20     def parse(self, response):
  21         idata = json.loads(response.body_as_unicode())
  22         storeids = idata.keys()
  23         URL = 'https://www.motel6.com/var/g6/hotel-information/en/{}.json'
  24         for storeid in storeids:
  25             try:
  26                 int(storeid)
  27             except ValueError:
  28                 continue
  29             try:
  30                 yield scrapy.Request(URL.format(storeid), callback=self.parse_hotel)
  31             except ValueError:
  32                 continue
  33 
  34     def parse_hotel(self, response):
  35         mdata = json.loads(response.body_as_unicode())
  36 
  37         properties = {
  38                     'ref': mdata["property_id"],
  39                     'name': mdata["name"],
  40                     'addr_full': mdata["address"],
  41                     'city': mdata["city"],
  42                     'postcode': mdata["zip"],
  43                     'lat': mdata["latitude"],
  44                     'lon': mdata["longitude"],
  45                     'phone': mdata["phone"],
  46                     'state': mdata["state"],
  47                     'website': mdata["microsite_url"],
  48                     'brand': brand_lookup[mdata["brand_id"]],
  49         }
  50 
  51         yield GeojsonPointItem(**properties)
  52
  [end of locations/spiders/motel6.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/locations/spiders/motel6.py b/locations/spiders/motel6.py
  --- a/locations/spiders/motel6.py
  +++ b/locations/spiders/motel6.py
  @@ -14,20 +14,21 @@
       name = "motel6"
       allowed_domains = ["motel6.com"]
       start_urls = (
  -        'https://www.motel6.com/var/g6/hotel-summary/ms.infinity.1.json',
  +        'https://www.motel6.com/content/g6-cache/property-summary.1.json',
       )
   
       def parse(self, response):
           idata = json.loads(response.body_as_unicode())
  -        storeids = idata.keys()
  -        URL = 'https://www.motel6.com/var/g6/hotel-information/en/{}.json'
  -        for storeid in storeids:
  +        url = 'https://www.motel6.com/bin/g6/propertydata.{}.json'
  +
  +        for storeid in idata.keys():
               try:
                   int(storeid)
               except ValueError:
                   continue
  +
               try:
  -                yield scrapy.Request(URL.format(storeid), callback=self.parse_hotel)
  +                yield scrapy.Request(url.format(storeid), callback=self.parse_hotel)
               except ValueError:
                   continue
   
  @@ -35,17 +36,17 @@
           mdata = json.loads(response.body_as_unicode())
   
           properties = {
  -                    'ref': mdata["property_id"],
  -                    'name': mdata["name"],
  -                    'addr_full': mdata["address"],
  -                    'city': mdata["city"],
  -                    'postcode': mdata["zip"],
  -                    'lat': mdata["latitude"],
  -                    'lon': mdata["longitude"],
  -                    'phone': mdata["phone"],
  -                    'state': mdata["state"],
  -                    'website': mdata["microsite_url"],
  -                    'brand': brand_lookup[mdata["brand_id"]],
  +            'ref': mdata["property_id"],
  +            'name': mdata["name"],
  +            'addr_full': mdata["address"],
  +            'city': mdata["city"],
  +            'postcode': mdata["zip"],
  +            'lat': mdata["latitude"],
  +            'lon': mdata["longitude"],
  +            'phone': mdata["phone"],
  +            'state': mdata["state"],
  +            'website': mdata["microsite_url"],
  +            'brand': brand_lookup[mdata["brand_id"]],
           }
   
           yield GeojsonPointItem(**properties)
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/motel6.py b/locations/spiders/motel6.py\n--- a/locations/spiders/motel6.py\n+++ b/locations/spiders/motel6.py\n@@ -14,20 +14,21 @@\n     name = \"motel6\"\n     allowed_domains = [\"motel6.com\"]\n     start_urls = (\n-        'https://www.motel6.com/var/g6/hotel-summary/ms.infinity.1.json',\n+        'https://www.motel6.com/content/g6-cache/property-summary.1.json',\n     )\n \n     def parse(self, response):\n         idata = json.loads(response.body_as_unicode())\n-        storeids = idata.keys()\n-        URL = 'https://www.motel6.com/var/g6/hotel-information/en/{}.json'\n-        for storeid in storeids:\n+        url = 'https://www.motel6.com/bin/g6/propertydata.{}.json'\n+\n+        for storeid in idata.keys():\n             try:\n                 int(storeid)\n             except ValueError:\n                 continue\n+\n             try:\n-                yield scrapy.Request(URL.format(storeid), callback=self.parse_hotel)\n+                yield scrapy.Request(url.format(storeid), callback=self.parse_hotel)\n             except ValueError:\n                 continue\n \n@@ -35,17 +36,17 @@\n         mdata = json.loads(response.body_as_unicode())\n \n         properties = {\n-                    'ref': mdata[\"property_id\"],\n-                    'name': mdata[\"name\"],\n-                    'addr_full': mdata[\"address\"],\n-                    'city': mdata[\"city\"],\n-                    'postcode': mdata[\"zip\"],\n-                    'lat': mdata[\"latitude\"],\n-                    'lon': mdata[\"longitude\"],\n-                    'phone': mdata[\"phone\"],\n-                    'state': mdata[\"state\"],\n-                    'website': mdata[\"microsite_url\"],\n-                    'brand': brand_lookup[mdata[\"brand_id\"]],\n+            'ref': mdata[\"property_id\"],\n+            'name': mdata[\"name\"],\n+            'addr_full': mdata[\"address\"],\n+            'city': mdata[\"city\"],\n+            'postcode': mdata[\"zip\"],\n+            'lat': mdata[\"latitude\"],\n+            'lon': mdata[\"longitude\"],\n+            'phone': mdata[\"phone\"],\n+            'state': mdata[\"state\"],\n+            'website': mdata[\"microsite_url\"],\n+            'brand': brand_lookup[mdata[\"brand_id\"]],\n         }\n \n         yield GeojsonPointItem(**properties)\n", "issue": "Spider motel6 is broken\nDuring the global build at 2021-08-18-14-42-26, spider **motel6** failed with **0 features** and **2 errors**.\n\nHere's [the log](https://data.alltheplaces.xyz/runs/2021-08-18-14-42-26/logs/motel6.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-08-18-14-42-26/output/motel6.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-08-18-14-42-26/output/motel6.geojson))\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nimport scrapy\nimport json\nfrom locations.items import GeojsonPointItem\n\nbrand_lookup = {\n    \"MS\": \"Motel 6\",\n    \"SS\": \"Studio 6\",\n    \"HS\": \"Hotel 6\"\n}\n\n\nclass Motel6Spider(scrapy.Spider):\n    name = \"motel6\"\n    allowed_domains = [\"motel6.com\"]\n    start_urls = (\n        'https://www.motel6.com/var/g6/hotel-summary/ms.infinity.1.json',\n    )\n\n    def parse(self, response):\n        idata = json.loads(response.body_as_unicode())\n        storeids = idata.keys()\n        URL = 'https://www.motel6.com/var/g6/hotel-information/en/{}.json'\n        for storeid in storeids:\n            try:\n                int(storeid)\n            except ValueError:\n                continue\n            try:\n                yield scrapy.Request(URL.format(storeid), callback=self.parse_hotel)\n            except ValueError:\n                continue\n\n    def parse_hotel(self, response):\n        mdata = json.loads(response.body_as_unicode())\n\n        properties = {\n                    'ref': mdata[\"property_id\"],\n                    'name': mdata[\"name\"],\n                    'addr_full': mdata[\"address\"],\n                    'city': mdata[\"city\"],\n                    'postcode': mdata[\"zip\"],\n                    'lat': mdata[\"latitude\"],\n                    'lon': mdata[\"longitude\"],\n                    'phone': mdata[\"phone\"],\n                    'state': mdata[\"state\"],\n                    'website': mdata[\"microsite_url\"],\n                    'brand': brand_lookup[mdata[\"brand_id\"]],\n        }\n\n        yield GeojsonPointItem(**properties)\n", "path": "locations/spiders/motel6.py"}]}