如何下载 URL 很长的文件?

如何下载 URL 很长的文件?

我尝试下载 JSON 文件,但使用所有下载工具(WinHTTrack 等等……)均失败。

问题是:文件 URL 很长,大约 4k 个字符,似乎没有工具能够处理这样的 URL 长度。Google 的限制是 2k 左右。

有什么解决方法可以下载此类文件?

URL 缩短我也尝试过了:没有 URL 缩短器能够缩短这样的 URL。

附言

  • 我尝试下载的 URL 看起来像

  • 我尝试使用的 WGet 的答案如下:

      ---request begin---
      GET /graphql?query=query%20productDetail(%24urlKey%3AString%2C%24onServer%3ABoolean!)%7BproductDetail%3Aproducts(filter%3A%7Burl_key%3A%7Beq%3A%24urlKey%7D%7D)%7Bitems%7B__typename%20id%20sku%20name%20name_wout_brand%20on_hand_priority_text%20on_hand_priority%20is_preowned%20brand_name%20brand_url%20manufacturer%20url_key%20stock_status%20out_of_stock_template%20out_of_stock_template_text%20price_promo_text%20promotext_code%20promotext_type%20promotext_value%20shipping_availability%20is_shipping_free_message%20shipping_question_mark_note%20model_id%20image%7Blabel%20url%20__typename%7Dupc_code%20item_variation%20media_gallery%7B...%20on%20ProductImage%7Blabel%20role%20url%20sizes%7Bimage_id%20url%20__typename%7Durl_nocache%20__typename%7D__typename%7Dbreadcrumbs%7Bpath%20categories%7Bname%20url_key%20__typename%7D__typename%7Dreview_details%7Breview_summary%20review_count%20__typename%7Drating_configurations%7Brating_attributes%20__typename%7Dshort_description%7Bhtml%20__typename%7Ddescription%7Bhtml%20__typename%7Dmoredetails%7Bdescription%20more_details%7Bgroup_id%20group_label%20group_attributes%7Battribute_id%20attribute_label%20attribute_value%20__typename%7D__typename%7D__typename%7Dmsrp%20price_range%7Bminimum_price%7Bregular_price%7Bvalue%20currency%20__typename%7Dfinal_price%7Bvalue%20currency%20__typename%7Dprice_promo_text%20msrp_price%7Bvalue%20currency%20__typename%7Ddiscount_on_msrp%7Bamount_off%20percent_off%20__typename%7Ddiscount%7Bamount_off%20percent_off%20__typename%7D__typename%7D__typename%7Dcategories%7Bbreadcrumbs%7Bcategory_id%20category_name%20__typename%7D__typename%7D...%20on%20GroupedProduct%7Bitems%7Bqty%20position%20product%7Bid%20sku%20stock_status%20name%20brand_name%20name_wout_brand%20manufacturer%20manufacturer_text%20is_shipping_free_message%20shipping_availability%20url_key%20is_preowned%20preowned_item_condition%20preowned_item_condition_text%20preowned_box%20preowned_papers%20preowned_papers_year%20preowned_condition_description%20on_hand_priority_text%20on_hand_priority%20shipping_question_mark_note%20model_id%20msrp%20price_range%7Bminimum_price%7Bregular_price%7Bvalue%20currency%20__typename%7Dfinal_price%7Bvalue%20currency%20__typename%7Dprice_promo_text%20msrp_price%7Bvalue%20currency%20__typename%7Ddiscount_on_msrp%7Bamount_off%20percent_off%20__typename%7Ddiscount%7Bamount_off%20percent_off%20__typename%7D__typename%7D__typename%7Dmedia_gallery%7B...%20on%20ProductImage%7Blabel%20role%20url%20sizes%7Bimage_id%20url%20__typename%7Durl_nocache%20__typename%7D__typename%7Dmoredetails%7Bdescription%20__typename%7D__typename%7D__typename%7D__typename%7D...%20on%20ConfigurableProduct%7Bconfigurable_options%7Battribute_code%20attribute_id%20id%20label%20values%7Bdefault_label%20label%20store_label%20use_default_value%20value_index%20swatch_data%7Btype%20value...%20on%20ImageSwatchData%7Bthumbnail%20__typename%7D__typename%7D__typename%7D__typename%7Dvariants%7Battributes%7Bcode%20value_index%20label%20__typename%7Dproduct%7Bid%20brand_name%20brand_url%20brand_size%20manufacturer%20shipping_availability%20is_shipping_free_message%20shipping_question_mark_note%20name_wout_brand%20msrp%20price_promo_text%20promotext_code%20promotext_type%20promotext_value%20is_preowned%20model_id%20on_hand_priority_text%20on_hand_priority%20price_range%7Bminimum_price%7Bregular_price%7Bvalue%20currency%20__typename%7Dfinal_price%7Bvalue%20currency%20__typename%7Dprice_promo_text%20msrp_price%7Bvalue%20currency%20__typename%7Ddiscount_on_msrp%7Bamount_off%20percent_off%20__typename%7Ddiscount%7Bamount_off%20percent_off%20__typename%7D__typename%7D__typename%7Dmedia_gallery%7B...%20on%20ProductImage%7Blabel%20role%20url%20sizes%7Bimage_id%20url%20__typename%7Durl_nocache%20__typename%7D__typename%7Dsku%20stock_status%20moredetails%7Bdescription%20__typename%7D__typename%7D__typename%7D__typename%7D...%20on%20GiftCardProduct%7Ballow_open_amount%20open_amount_min%20open_amount_max%20giftcard_type%20is_redeemable%20lifetime%20allow_message%20message_max_length%20giftcard_amounts%7Bvalue_id%20website_id%20website_value%20attribute_id%20value%20__typename%7D__typename%7Dmeta_title%40include(if%3A%24onServer)meta_keyword%40include(if%3A%24onServer)meta_description%40include(if%3A%24onServer)canonical_url%40include(if%3A%24onServer)%7D__typename%7D%7D&operationName=productDetail&variables=%7B%22urlKey%22%3A%22raymond-weil-watch-7730-stc-65112%22%2C%22onServer%22%3Atrue%7D HTTP/1.1
      User-Agent: Wget/1.21.1
      Accept: */*
      Accept-Encoding: identity
      Host: www.jomashop.com
      Connection: Keep-Alive
    
      ---request end---
      HTTP request sent, awaiting response...
      ---response begin---
      HTTP/1.1 200 OK
      Date: Sun, 13 Jun 2021 18:08:53 GMT
      Content-Type: application/json
      Transfer-Encoding: chunked
      Connection: keep-alive
      CF-Ray: 65ed444b78aa2bd6-FRA
      Cache-Control: no-store, no-cache, must-revalidate, max-age=0
      Expires: -1
      Vary: Accept-Encoding
      CF-Cache-Status: DYNAMIC
      cf-request-id: 0aa829032900002bd6d2af7000000001
      Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
      Pragma: no-cache
      X-Content-Type-Options: nosniff
      X-Frame-Options: SAMEORIGIN
      X-XSS-Protection: 1; mode=block
      Set-Cookie: __cf_bm=4869eeab9dbfe8c9ee32cdb28717105373105b26-1623607733-1800-AdcZOtzt129uH6bUp4GVNVqad3bFfj1wNOaoyVb3lYJ21ejdcbH3x4BSznjiPpyX4cJj5WpjoVvm7ys5yd3y+MH/jScid6FAhGgMGVuwwt3u; path=/; expires=Sun, 13-Jun-21 18:38:53 GMT; domain=.jomashop.com; HttpOnly; Secure; SameSite=None
      Server: cloudflare
      alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; ma=86400
    
      ---response end---
      200 OK
      cdm: 1
    
      Stored cookie jomashop.com -1 (ANY) / <permanent> <secure> [expiry 2021-06-13 20:38:53] __cf_bm 4869eeab9dbfe8c9ee32cdb28717105373105b26-1623607733-1800-AdcZOtzt129uH6bUp4GVNVqad3bFfj1wNOaoyVb3lYJ21ejdcbH3x4BSznjiPpyX4cJj5WpjoVvm7ys5yd3y+MH/jScid6FAhGgMGVuwwt3u
      Registered socket 3 for persistent reuse.
      Length: unspecified [application/json]
      graphql@query=query productDetail($urlKey%3AString,$onServer%3ABoolean!){productDetail%3Aproducts(filter%3A{url_key%3A{eq%3A$urlKey}}){items{__typename id sku name name_wout_brand on_hand_priority_text on_hand_priority is_preowned brand_na: No such file or directory
      Disabling further reuse of socket 3.
      Closed 3/SSL 0x000000001094c020
    
      Cannot write to 'graphql@query=query productDetail($urlKey%3AString,$onServer%3ABoolean!){productDetail%3Aproducts(filter%3A{url_key%3A{eq%3A$urlKey}}){items{__typename id sku name name_wout_brand on_hand_priority_text on_hand_priority is_preowned brand_na' (Bad file descriptor).
      converted 'https://www.jomashop.com/graphql?query=query%20productDetail(%24urlKey%3AString%2C%24onServer%3ABoolean!)%7BproductDetail%3Aproducts(filter%3A%7Burl_key%3A%7Beq%3A%24urlKey%7D%7D)%7Bitems%7B__typename%20id%20sku%20name%20name_wout_brand%20on_hand_priority_text%20on_hand_priority%20is_preowned%20brand_name%20brand_url%20manufacturer%20url_key%20stock_status%20out_of_stock_template%20out_of_stock_template_text%20price_promo_text%20promotext_code%20promotext_type%20promotext_value%20shipping_availability%20is_shipping_free_message%20shipping_question_mark_note%20model_id%20image%7Blabel%20url%20__typename%7Dupc_code%20item_variation%20media_gallery%7B...%20on%20ProductImage%7Blabel%20role%20url%20sizes%7Bimage_id%20url%20__typename%7Durl_nocache%20__typename%7D__typename%7Dbreadcrumbs%7Bpath%20categories%7Bname%20url_key%20__typename%7D__typename%7Dreview_details%7Breview_summary%20review_count%20__typename%7Drating_configurations%7Brating_attributes%20__typename%7Dshort_description%7Bhtml%20__typename%7Ddescription%7Bhtml%20__typename%7Dmoredetails%7Bdescription%20more_details%7Bgroup_id%20group_label%20group_attributes%7Battribute_id%20attribute_label%20attribute_value%20__typename%7D__typename%7D__typename%7Dmsrp%20price_range%7Bminimum_price%7Bregular_price%7Bvalue%20currency%20__typename%7Dfinal_price%7Bvalue%20currency%20__typename%7Dprice_promo_text%20msrp_price%7Bvalue%20currency%20__typename%7Ddiscount_on_msrp%7Bamount_off%20percent_off%20__typename%7Ddiscount%7Bamount_off%20percent_off%20__typename%7D__typename%7D__typename%7Dcategories%7Bbreadcrumbs%7Bcategory_id%20category_name%20__typename%7D__typename%7D...%20on%20GroupedProduct%7Bitems%7Bqty%20position%20product%7Bid%20sku%20stock_status%20name%20brand_name%20name_wout_brand%20manufacturer%20manufacturer_text%20is_shipping_free_message%20shipping_availability%20url_key%20is_preowned%20preowned_item_condition%20preowned_item_condition_text%20preowned_box%20preowned_papers%20preowned_papers_year%20preowned_condition_description%20on_hand_priority_text%20on_hand_priority%20shipping_question_mark_note%20model_id%20msrp%20price_range%7Bminimum_price%7Bregular_price%7Bvalue%20currency%20__typename%7Dfinal_price%7Bvalue%20currency%20__typename%7Dprice_promo_text%20msrp_price%7Bvalue%20currency%20__typename%7Ddiscount_on_msrp%7Bamount_off%20percent_off%20__typename%7Ddiscount%7Bamount_off%20percent_off%20__typename%7D__typename%7D__typename%7Dmedia_gallery%7B...%20on%20ProductImage%7Blabel%20role%20url%20sizes%7Bimage_id%20url%20__typename%7Durl_nocache%20__typename%7D__typename%7Dmoredetails%7Bdescription%20__typename%7D__typename%7D__typename%7D__typename%7D...%20on%20ConfigurableProduct%7Bconfigurable_options%7Battribute_code%20attribute_id%20id%20label%20values%7Bdefault_label%20label%20store_label%20use_default_value%20value_index%20swatch_data%7Btype%20value...%20on%20ImageSwatchData%7Bthumbnail%20__typename%7D__typename%7D__typename%7D__typename%7Dvariants%7Battributes%7Bcode%20value_index%20label%20__typename%7Dproduct%7Bid%20brand_name%20brand_url%20brand_size%20manufacturer%20shipping_availability%20is_shipping_free_message%20shipping_question_mark_note%20name_wout_brand%20msrp%20price_promo_text%20promotext_code%20promotext_type%20promotext_value%20is_preowned%20model_id%20on_hand_priority_text%20on_hand_priority%20price_range%7Bminimum_price%7Bregular_price%7Bvalue%20currency%20__typename%7Dfinal_price%7Bvalue%20currency%20__typename%7Dprice_promo_text%20msrp_price%7Bvalue%20currency%20__typename%7Ddiscount_on_msrp%7Bamount_off%20percent_off%20__typename%7Ddiscount%7Bamount_off%20percent_off%20__typename%7D__typename%7D__typename%7Dmedia_gallery%7B...%20on%20ProductImage%7Blabel%20role%20url%20sizes%7Bimage_id%20url%20__typename%7Durl_nocache%20__typename%7D__typename%7Dsku%20stock_status%20moredetails%7Bdescription%20__typename%7D__typename%7D__typename%7D__typename%7D...%20on%20GiftCardProduct%7Ballow_open_amount%20open_amount_min%20open_amount_max%20giftcard_type%20is_redeemable%20lifetime%20allow_message%20message_max_length%20giftcard_amounts%7Bvalue_id%20website_id%20website_value%20attribute_id%20value%20__typename%7D__typename%7Dmeta_title%40include(if%3A%24onServer)meta_keyword%40include(if%3A%24onServer)meta_description%40include(if%3A%24onServer)canonical_url%40include(if%3A%24onServer)%7D__typename%7D%7D&operationName=productDetail&variables=%7B%22urlKey%22%3A%22raymond-weil-watch-7730-stc-jhdx1%22%2C%22onServer%22%3Atrue%7D' (CP1252) -> 'https://www.jomashop.com/graphql?query=query productDetail(%24urlKey%3AString%2C%24onServer%3ABoolean!){productDetail%3Aproducts(filter%3A{url_key%3A{eq%3A%24urlKey}}){items{__typename id sku name name_wout_brand on_hand_priority_text on_hand_priority is_preowned brand_name brand_url manufacturer url_key stock_status out_of_stock_template out_of_stock_template_text price_promo_text promotext_code promotext_type promotext_value shipping_availability is_shipping_free_message shipping_question_mark_note model_id image{label url __typename}upc_code item_variation media_gallery{... on ProductImage{label role url sizes{image_id url __typename}url_nocache __typename}__typename}breadcrumbs{path categories{name url_key __typename}__typename}review_details{review_summary review_count __typename}rating_configurations{rating_attributes __typename}short_description{html __typename}description{html __typename}moredetails{description more_details{group_id group_label group_attributes{attribute_id attribute_label attribute_value __typename}__typename}__typename}msrp price_range{minimum_price{regular_price{value currency __typename}final_price{value currency __typename}price_promo_text msrp_price{value currency __typename}discount_on_msrp{amount_off percent_off __typename}discount{amount_off percent_off __typename}__typename}__typename}categories{breadcrumbs{category_id category_name __typename}__typename}... on GroupedProduct{items{qty position product{id sku stock_status name brand_name name_wout_brand manufacturer manufacturer_text is_shipping_free_message shipping_availability url_key is_preowned preowned_item_condition preowned_item_condition_text preowned_box preowned_papers preowned_papers_year preowned_condition_description on_hand_priority_text on_hand_priority shipping_question_mark_note model_id msrp price_range{minimum_price{regular_price{value currency __typename}final_price{value currency __typename}price_promo_text msrp_price{value currency __typename}discount_on_msrp{amount_off percent_off __typename}discount{amount_off percent_off __typename}__typename}__typename}media_gallery{... on ProductImage{label role url sizes{image_id url __typename}url_nocache __typename}__typename}moredetails{description __typename}__typename}__typename}__typename}... on ConfigurableProduct{configurable_options{attribute_code attribute_id id label values{default_label label store_label use_default_value value_index swatch_data{type value... on ImageSwatchData{thumbnail __typename}__typename}__typename}__typename}variants{attributes{code value_index label __typename}product{id brand_name brand_url brand_size manufacturer shipping_availability is_shipping_free_message shipping_question_mark_note name_wout_brand msrp price_promo_text promotext_code promotext_type promotext_value is_preowned model_id on_hand_priority_text on_hand_priority price_range{minimum_price{regular_price{value currency __typename}final_price{value currency __typename}price_promo_text msrp_price{value currency __typename}discount_on_msrp{amount_off percent_off __typename}discount{amount_off percent_off __typename}__typename}__typename}media_gallery{... on ProductImage{label role url sizes{image_id url __typename}url_nocache __typename}__typename}sku stock_status moredetails{description __typename}__typename}__typename}__typename}... on GiftCardProduct{allow_open_amount open_amount_min open_amount_max giftcard_type is_redeemable lifetime allow_message message_max_length giftcard_amounts{value_id website_id website_value attribute_id value __typename}__typename}meta_title%40include(if%3A%24onServer)meta_keyword%40include(if%3A%24onServer)meta_description%40include(if%3A%24onServer)canonical_url%40include(if%3A%24onServer)}__typename}}&operationName=productDetail&variables={"urlKey"%3A"raymond-weil-watch-7730-stc-jhdx1"%2C"onServer"%3Atrue}' (UTF-8)
      Converted file name 'graphql@query=query productDetail($urlKey%3AString,$onServer%3ABoolean!){productDetail%3Aproducts(filter%3A{url_key%3A{eq%3A$urlKey}}){items{__typename id sku name name_wout_brand on_hand_priority_text on_hand_priority is_preowned brand_name brand_url manufacturer url_key stock_status out_of_stock_template out_of_stock_template_text price_promo_text promotext_code promotext_type promotext_value shipping_availability is_shipping_free_message shipping_question_mark_note model_id image{label url __typename}upc_code item_variation media_gallery{... on ProductImage{label role url sizes{image_id url __typename}url_nocache __typename}__typename}breadcrumbs{path categories{name url_key __typename}__typename}review_details{review_summary review_count __typename}rating_configurations{rating_attributes __typename}short_description{html __typename}description{html __typename}moredetails{description more_details{group_id group_label group_attributes{attribute_id attribute_label attribute_value __typename}__typename}__typename}msrp price_range{minimum_price{regular_price{value currency __typename}final_price{value currency __typename}price_promo_text msrp_price{value currency __typename}discount_on_msrp{amount_off percent_off __typename}discount{amount_off percent_off __typename}__typename}__typename}categories{breadcrumbs{category_id category_name __typename}__typename}... on GroupedProduct{items{qty position product{id sku stock_status name brand_name name_wout_brand manufacturer manufacturer_text is_shipping_free_message shipping_availability url_key is_preowned preowned_item_condition preowned_item_condition_text preowned_box preowned_papers preowned_papers_year preowned_condition_description on_hand_priority_text on_hand_priority shipping_question_mark_note model_id msrp price_range{minimum_price{regular_price{value currency __typename}final_price{value currency __typename}price_promo_text msrp_price{value currency __typename}discount_on_msrp{amount_off percent_off __typename}discount{amount_off percent_off __typename}__typename}__typename}media_gallery{... on ProductImage{label role url sizes{image_id url __typename}url_nocache __typename}__typename}moredetails{description __typename}__typename}__typename}__typename}... on ConfigurableProduct{configurable_options{attribute_code attribute_id id label values{default_label label store_label use_default_value value_index swatch_data{type value... on ImageSwatchData{thumbnail __typename}__typename}__typename}__typename}variants{attributes{code value_index label __typename}product{id brand_name brand_url brand_size manufacturer shipping_availability is_shipping_free_message shipping_question_mark_note name_wout_brand msrp price_promo_text promotext_code promotext_type promotext_value is_preowned model_id on_hand_priority_text on_hand_priority price_range{minimum_price{regular_price{value currency __typename}final_price{value currency __typename}price_promo_text msrp_price{value currency __typename}discount_on_msrp{amount_off percent_off __typename}discount{amount_off percent_off __typename}__typename}__typename}media_gallery{... on ProductImage{label role url sizes{image_id url __typename}url_nocache __typename}__typename}sku stock_status moredetails{description __typename}__typename}__typename}__typename}... on GiftCardProduct{allow_open_amount open_amount_min open_amount_max giftcard_type is_redeemable lifetime allow_message message_max_length giftcard_amounts{value_id website_id website_value attribute_id value __typename}__typename}meta_title@include(if%3A$onServer)meta_keyword@include(if%3A$onServer)meta_description@include(if%3A$onServer)canonical_url@include(if%3A$onServer)}__typename}}&operationName=productDetail&variables={%22urlKey%22%3A%22raymond-weil-watch-7730-stc-jhdx1%22,%22onServer%22%3Atrue}' (UTF-8) -> 'graphql@query=query productDetail($urlKey%3AString,$onServer%3ABoolean!){productDetail%3Aproducts(filter%3A{url_key%3A{eq%3A$urlKey}}){items{__typename id sku name name_wout_brand on_hand_priority_text on_hand_priority is_preowned brand_name brand_url manufacturer url_key stock_status out_of_stock_template out_of_stock_template_text price_promo_text promotext_code promotext_type promotext_value shipping_availability is_shipping_free_message shipping_question_mark_note model_id image{label url __typename}upc_code item_variation media_gallery{... on ProductImage{label role url sizes{image_id url __typename}url_nocache __typename}__typename}breadcrumbs{path categories{name url_key __typename}__typename}review_details{review_summary review_count __typename}rating_configurations{rating_attributes __typename}short_description{html __typename}description{html __typename}moredetails{description more_details{group_id group_label group_attributes{attribute_id attribute_label attribute_value __typename}__typename}__typename}msrp price_range{minimum_price{regular_price{value currency __typename}final_price{value currency __typename}price_promo_text msrp_price{value currency __typename}discount_on_msrp{amount_off percent_off __typename}discount{amount_off percent_off __typename}__typename}__typename}categories{breadcrumbs{category_id category_name __typename}__typename}... on GroupedProduct{items{qty position product{id sku stock_status name brand_name name_wout_brand manufacturer manufacturer_text is_shipping_free_message shipping_availability url_key is_preowned preowned_item_condition preowned_item_condition_text preowned_box preowned_papers preowned_papers_year preowned_condition_description on_hand_priority_text on_hand_priority shipping_question_mark_note model_id msrp price_range{minimum_price{regular_price{value currency __typename}final_price{value currency __typename}price_promo_text msrp_price{value currency __typename}discount_on_msrp{amount_off percent_off __typename}discount{amount_off percent_off __typename}__typename}__typename}media_gallery{... on ProductImage{label role url sizes{image_id url __typename}url_nocache __typename}__typename}moredetails{description __typename}__typename}__typename}__typename}... on ConfigurableProduct{configurable_options{attribute_code attribute_id id label values{default_label label store_label use_default_value value_index swatch_data{type value... on ImageSwatchData{thumbnail __typename}__typename}__typename}__typename}variants{attributes{code value_index label __typename}product{id brand_name brand_url brand_size manufacturer shipping_availability is_shipping_free_message shipping_question_mark_note name_wout_brand msrp price_promo_text promotext_code promotext_type promotext_value is_preowned model_id on_hand_priority_text on_hand_priority price_range{minimum_price{regular_price{value currency __typename}final_price{value currency __typename}price_promo_text msrp_price{value currency __typename}discount_on_msrp{amount_off percent_off __typename}discount{amount_off percent_off __typename}__typename}__typename}media_gallery{... on ProductImage{label role url sizes{image_id url __typename}url_nocache __typename}__typename}sku stock_status moredetails{description __typename}__typename}__typename}__typename}... on GiftCardProduct{allow_open_amount open_amount_min open_amount_max giftcard_type is_redeemable lifetime allow_message message_max_length giftcard_amounts{value_id website_id website_value attribute_id value __typename}__typename}meta_title@include(if%3A$onServer)meta_keyword@include(if%3A$onServer)meta_description@include(if%3A$onServer)canonical_url@include(if%3A$onServer)}__typename}}&operationName=productDetail&variables={%22urlKey%22%3A%22raymond-weil-watch-7730-stc-jhdx1%22,%22onServer%22%3Atrue}' (CP1252)
      The name is too long, 3814 chars total.
      Trying to shorten...
      New name is graphql@query=query productDetail($urlKey%3AString,$onServer%3ABoolean!){productDetail%3Aproducts(filter%3A{url_key%3A{eq%3A$urlKey}}){items{__typename id sku name name_wout_brand on_hand_priority_text on_hand_priority is_preowned brand_na.
    
      Found www.jomashop.com in host_name_addresses_map (0000000007b14a20)
      Connecting to www.jomashop.com (www.jomashop.com)|104.20.213.46|:443... seconds 0,00, connected.
      Created socket 3.
      Releasing 0x0000000007b14a20 (new refcount 1).
      Initiating SSL handshake.
      Handshake successful; connected socket 3 to SSL handle 0x000000001094c020
      certificate:
        subject: CN=jomashop.com,O=Jomashop Inc.,L=Brooklyn,ST=New York,C=US,serialNumber=1493412,businessCategory=Private Organization,jurisdictionST=New York,jurisdictionC=US
        issuer:  CN=Go Daddy Secure Certificate Authority - G2,OU=http://certs.godaddy.com/repository/,O=GoDaddy.com\\, Inc.,L=Scottsdale,ST=Arizona,C=US
      X509 certificate successfully verified and matches host www.jomashop.com
    

答案1

从你的例子现在可以清楚知道问题是什么:

无法写入‘…’(坏的文件描述符)。
已转换‘<非常长的 url>’(UTF-8)
已转换的文件名‘<许多字符>’(CP1252)
名称太长,总共 3814 个字符。

在这种情况下,解决方案非常简单:只需指定一个目标文件名即可不是太长:

wget -O my-result.json "<very long url>"

使用 GraphQL 你可以或许还可以通过 POST 方式发送查询,而不是在 URL 中指定它。这样可以解决任何 URL 长度问题。

相关内容