How to get info about licensed video? | get_video_info - youtube

I have one problem, when i try to get URL of licensed video i get fail.
Its not return any video URL from licensed video.
For example:
"https://www.youtube.com/watch?v=3O1_3zBUKM8"
When i tried to get url i get fail.
// THIS CODE https://gist.github.com/el3zahaby/9e60f1ae3168c38cc0f0054c15cd6a83
I tried to find solution but there is no answear:
-Most of videos not getting VideoUrl from YouTube
-How do I get video info for Youtube Vevo Videos?
How its possible ??
if I want to get urls of all the videos, so what's the solution ??

Since the videoId you're requesting has restrictions for embed it, you wont be able to get further information.
In the request you get the following result:
[
{
"itct": "CAEQu2kiEwjGrqPtqrvgAhXL3WAKHTzzB-8op5UD",
"watermark": ",http://s.ytimg.com/yts/img/watermark/youtube_watermark-vflHX6b6E.png,http://s.ytimg.com/yts/img/watermark/youtube_hd_watermark-vflAzLcD6.png",
"ldpj": "-2",
"apiary_host_firstparty": "",
"timestamp": "1550151100",
"url_encoded_fmt_stream_map": "",
"apiary_host": "",
"author": "NaughtyBoyVEVO",
"video_id": "3O1_3zBUKM8",
"external_play_video": "1",
"subreason": "",
"host_language": "en",
"root_ve_type": "51879",
"cr": "US",
"length_seconds": "244",
"token": "1",
"vss_host": "s.youtube.com",
"csi_page_type": "embed",
"title": "Naughty Boy - La la la ft. Sam Smith",
"t": "1",
"fflags": "html5_min_buffer_to_resume=6&html5_disable_extra_update_resource=true&ad_to_video_use_gel=true&live_fresca_v2=true&html5_streaming_xhr_buffer_mdat=true&html5_license_constraint_delay=5000&disable_client_side_midroll_freq_capping_nonpc=true&html5_request_size_padding_secs=3.0&use_fast_fade_in_0s=true&html5_tight_max_buffer_allowed_impaired_time=0.0&mweb_enable_instream_ui_refresh=true&spacecast_uniplayer_decorate_manifest=true&bulleit_round_up_tsla=true&mweb_undim_skip_button_on_ad_pause=true&html5_connect_timeout_secs=7.0&html5_post_interrupt_readahead=20&html5_subsegment_readahead_target_buffer_health_secs=0.5&tv_html5_bulleit_unify_adinfo=true&html5_platform_minimum_readahead_seconds=0.0&show_thumbnail_on_standard=true&defer_player_config_and_threed_deciders=true&html5_tv_bearer=true&html5_video_tbd_min_kb=0&html5_peak_shave=true&use_survey_skip_in_0s=true&dynamic_ad_break_seek_threshold_sec=0&ima_disable_reset_active_media_load_timeout=true&html5_reason_reporting_migration=true&html5_use_adaptive_live_readahead=true&unplugged_tvhtml5_video_preload_on_focus_delay_ms=0&html5_log_playback_rate_change_killswitch=true&html5_default_ad_gain=0.5&html5_desktop_vr180_allow_panning=true&html5_minimum_readahead_seconds=0.0&html5_ad_no_buffer_abort_after_skippable=true&postroll_notify_time_seconds=5&html5_request_sizing_multiplier=0.8&mweb_bulleit_show_ad_top_bar_for_phones=true&html5_enable_webm_cue_refactor=true&attach_child_on_gel_web=true&log_playback_associated_web=true&html5_live_abr_repredict_fraction=0.0&use_local_interactions_library=true&html5_df_downgrade_thresh=0.0&html5_ignore_public_setPlaybackQuality=true&html5_jumbo_ull_nonstreaming_mffa_ms=4000&html5_get_video_info_timeout_ms=30000&html5_suspend_manifest_on_pause=true&html5_subsegment_readahead_require_whitelist=true&html5_av1_thresh_lcc=0&html5_store_xhr_headers_readable=true&html5_subsegment_readahead_min_load_speed=1.5&desktop_videowall_companion_wta_support=true&set_interstitial_advertisers_question_text=true&bulleit_update_tsla_cookie=true&use_new_skip_icon=true&html5_live_pin_to_tail=true&android_early_fetch_for_autoplay=true&html5_subsegment_readahead_min_buffer_health_secs_on_timeout=0.1&html5_live_4k_more_buffer=true&mweb_playsinline=true&html5_vp9_live_blacklist_edge=true&html5_msi_error_fallback=true&html5_media_fullscreen=true&mweb_muted_autoplay=true&dynamic_ad_break_pause_threshold_sec=0&delay_ads_gvi_call_on_bulleit_living_room_ms=0&html5_deadzone_multiplier=1.0&uniplayer_dbp=true&html5_disable_non_contiguous=true&use_forced_linebreak_preskip_text=true&deprecate_vss_dallas_cache=true&kevlar_miniplayer=true&html5_new_queueing=true&html5_live_ultra_low_latency_bandwidth_window=0.0&website_actions_throttle_percentage=1.0&desktop_cleanup_companion_on_instream_begin=true&enable_website_actions_on_mweb=true&html5_variability_discount=0.5&html5_widevine_hw_secure_all=true&html5_parse_inline_fallback_host=true&html5_live_abr_head_miss_fraction=0.0&preskip_button_style_ads_backend=countdown_next_to_thumbnail&show_thumbnail_behind_ypc_offer_module=true&html5_manifestless_synchronized=true&mpu_visible_threshold_count=2&enable_kevlar_action_companion_cleanup=true&mweb_autonav=true&tvhtml5_min_readbehind_secs=20&mweb_muted_autoplay_animation=shrink&doubleclick_gpt_retagging=true&html5_manifestless_no_redundant_seek_to_head=true&html5_live_normal_latency_bandwidth_window=0.0&show_interstitial_white=true&player_unified_fullscreen_transitions=true&html5_bmffparser_use_fast_read_string=true&html5_maximum_readahead_seconds=0.0&html5_min_readbehind_cap_secs=60&html5_request_size_min_secs=0.0&html5_remove_pause=false&html5_hls_initial_bitrate=0&enable_bulleit_mweb_gaming_ui=true&html5_use_hasAdvanced_for_pbs=true&interaction_click_on_gel_web=true&html5_aspect_from_adaptive_format=true&mweb_playsinline_webview=true&use_always_dimmed_skip_in_bulleit_web=true&html5_disable_move_pssh_to_moov=true&provide_default_wta_reasons=true&html5_probe_media_capabilities=true&html5_manifestless_always_redux=true&fast_autonav_in_background=true&html5_incremental_parser_buffer_duration_secs=1.5&variable_buffer_timeout_ms=0&enable_static_font_size_on_text_only_preview=true&html5_ignore_updates_before_initial_ping=true&show_interstitial_for_3s=true&vmap_enabled_living_room=true&html5_log_hls_video_height_change_as_format_change=true&turn_down_serialized_player_request_for_bulleit_living_room=true&live_readahead_seconds_multiplier=0.8&preskip_countdown_font_size=&html5_max_av_sync_drift=50&enable_live_premieres_vss_live_type_lp=true&web_player_api_logging_fraction=0.01&web_player_assume_format3_available=true&use_touch_events_for_bulleit_mweb=true&html5_inline_video_quality_survey=true&html5_suspend_loader=true&enable_bulleit_for_web_gaming=true&html5_disable_audio_slicing=true&html5_elbow_tracking_tweaks=true&html5_spherical_bicubic_mode=1&player_destroy_old_version=true&html5_use_streaming_xhr_abort_support=true&html5_player_autonav_logging=true&skip_restore_on_abandon_in_bulleit=true&bulleit_web_dim_skip_using_css=true&web_player_response_overlay_parsing=false&html5_dont_predict_end_time_in_past=true&html5_repredict_interval_secs=0.0&html5_vss_live_mode_killswitch=true&bulleit_mimic_ima_player_api_calls=true&visibility_error_html_dump_sample_rate=0.01&html5_playbackmanager_enable_notify_new_drm_info=true&html5_min_upgrade_health=0&use_refreshed_overlay_buttons=true&html5_max_live_dvr_window_plus_margin_secs=46800.0&html5_delay_initial_loading=true&web_player_sentinel=true&variable_load_timeout_ms=0&enable_overlay_hide_timer_fix=true&bulleit_block_player_pause_until_ad_start=true&set_default_wta_if_missing_for_externs=true&dash_manifest_version=5&bulleit_check_overlay_container_before_show=true&defer_playability_status_fillers=true&html5_waiting_before_ended=true&enable_bulleit_for_mweb=true&autoplay_time=8000&enable_bulleit_ve_single_clickthrough=true&html5_no_shadow_env_data_redux=true&html5_adjust_effective_request_size=true&mweb_cougar_big_controls=true&bulleit_disable_preroll_release_on_dispose=true&html5_default_quality_cap=0&web_logging_max_batch=100&enable_survey_ad_info_dialog=true&fixed_padding_skip_button=true&html5_expire_preloaded_players=true&fix_gpt_pos_params=true&html5_min_has_advanced=true&bulleit_send_engage_ping_on_companion_click=true&variable_buffer_timeout_living_room_ms=0&enable_bulleit_mweb_remix_ui=true&lasr_captions_holdback=true&enable_html5_conversion_ve_reporting=true&bulleit_use_touch_events_for_skip=true&desktop_companion_wta_support=true&enable_brand_companion_on_mweb=true&flex_theater_mode=true&youtubei_for_web=true&sdk_ad_prefetch_time_seconds=-1&playready_first_play_expiration=-1&html5_max_buffer_duration=120&max_resolution_for_white_noise=360&desktop_image_companion_wta_support=true&html5_subsegment_readahead_load_speed_check_interval=0.5&html5_manifestless_interpolate=true&html5_enable_widevine_key_rotation=true&enable_embed_autoplay_delay=true&enable_text_ad_overlay_link_fix=true&html5_request_size_max_secs=31&html5_disable_subscribe_new_vis=true&html5_enable_embedded_player_visibility_signals=true&html5_creativeless_vast_on_ima=true&mweb_cougar=true&stop_using_ima_sdk_gpt_request_activity=true&html5_background_cap_idle_secs=60&html5_qoe_bearer=true&html5_stale_dash_manifest_retry_factor=1.0&html5_new_seeking=true&html5_min_secs_between_format_selections=8.0&html5_incremental_parser_coalesce_slice_buffers=true&ad_duration_threshold_for_showing_endcap_seconds=15&bulleit_use_video_end_cuerange_for_completion=true&html5_cut_vss_on_visibility=true&html5_subsegment_readahead_seek_latency_fudge=0.5&embed_new_info_bar=true&html5_sticky_reduces_discount_by=0.0&html5_fludd_suspend=true&web_player_music_visualizer_treatment=fake&html5_no_audio_append_cap=true&html5_autonav_quality_cap=0&html5_ultra_low_latency_streaming_responses=true&ima_video_ad_with_overlay_class_logging_percentage=0.01&html5_frame_accurate_seek_limit=3&html5_subsegment_readahead_timeout_secs=2.0&kevlar_miniplayer_button=true&html5_shrink_live_timestamps=true&enable_mute_ad_endpoint_resolution_on_bulleit=true&html5_release_mediakey_after_load=true&interaction_screen_on_gel_web=true&process_extensions_in_vast_wrappers_for_survey_ads=true&html5_enable_non_diegetic=true&desktop_action_companion_wta_support=true&allow_midrolls_on_watch_resume_in_bulleit=true&enable_composite_ad_player_presentation_for_bulleit=true&html5_get_video_info_promiseajax=true&bulleit_register_cue_range_events_before_ad_init=true&html5_live_low_latency_bandwidth_window=0.0&html5_fallbacks_delay_primary_probes=true&show_countdown_on_bumper=true&embed_api_deprecation=true&android_attestation_flow=yt_player&enable_simple_preview_for_postrolls_html5=true&html5_probe_primary_delay_base_ms=0&html5_new_vis_fullscreen_and_airplay=true&html5_serverside_biscotti_id_wait_ms=1000&enable_instream_companion_on_mweb=true&html5_progressive_fallback=true&call_release_video_in_bulleit=true&html5_exile_broken_instances=true&html5_prefer_server_bwe3=true&enable_prefetch_for_postrolls=true&forced_brand_precap_duration_ms=2000&enable_endcap_on_mweb=true&html5_manifestless_captions=true&www_for_videostats=true&send_html5_api_stats_ads_abandon=true&html5_manifestless_request_prediction=true&disable_new_pause_state3=true&web_player_response_playback_tracking_parsing=true&delay_bulleit_media_load_timer=true&html5_disable_preserve_reference=true&tvhtml5_disable_live_prefetch=true&bulleit_use_http_get_by_default_for_get_midroll_info=true&html5_vp9_live_whitelist=true&vss_dni_delayping=0&html5_serverside_call_server_on_biscotti_timeout=true&html5_preload_media=true&html5_jumbo_ull_subsegment_readahead_target=1.3&bulleit_get_midroll_info_timeout_ms=8000&use_full_timing_library=true&disable_client_side_midroll_freq_capping=true&lasr_captions_holdback_counterfactual_id=23737673&html5_live_disable_dg_pacing=true&html5_pause_video_fix=true&html5_gapless=true&html5_log_rebuffer_events=0&bulleit_publish_external_playback_events=true&html5_max_readahead_bandwidth_cap=0&html5_live_no_streaming_impedance_mismatch=true&skip_ad_button_with_thumbnail=true&use_ima_media_selection_in_bulleit=true&html5_dynamic_readahead_growth_rate=0.0&segment_volume_reporting=true&html5_stop_video_in_cancel_playback=true&html5_serverside_call_server_on_biscotti_error=true&disable_survey_interstitial_for_non_bl_surveys_desktop=true&bulleit_extract_delayed_mpu_on_all_placement_init=true&html5_tight_max_buffer_allowed_bandwidth_stddevs=0.0&html5_streaming_xhr_progress_includes_latest=true&enable_bulleit=true&html5_qoe_intercept=&use_new_style=true&html5_optimality_migration=true&html5_probe_secondary_during_timeout_miss_count=2&html5_manifestless_accurate_sliceinfo=true&fix_bulleit_cue_range_seek=true&playready_on_borg=true&external_fullscreen_with_edu=true&html5_vis_upgrades_are_resizes=true&html5_use_media_capabilities=true&html5_pipeline_manifestless=true&mweb_ios_handle_player_click_by_touch_event=true&bulleit_register_placements_in_order=true&king_crimson_player_redux=true&persist_text_on_preview_button=true&enable_bulleit_lidar_integration=true&enable_afv_div_reset_in_kevlar=true&web_player_native_json=true&html5_subsegment_readahead_min_buffer_health_secs=0.25&midroll_notify_time_seconds=5&html5_background_quality_cap=360&html5_no_placeholder_rollbacks=true&html5_seeking_buffering_only_playing=true&web_player_kaios_autoplay=true&sdk_wrapper_levels_allowed=0&allow_live_autoplay=true&html5_variability_full_discount_thresh=3.0&legacy_autoplay_flag=true&html5_widevine_robustness_strings=true&tvhtml5_yongle_quality_cap=0&add_border_to_bulleit_mweb_skip=true&set_interstitial_start_button=true&html5_bandwidth_window_size=0&html5_streaming_xhr_optimize_lengthless_mp4=true&html5_allowable_liveness_drift_chunks=2&enable_overlays_wta=true&ad_video_end_renderer_duration_milliseconds=7000&html5_variability_no_discount_thresh=1.0&desktop_shopping_companion_wta_support=true&html5_probe_live_using_range=true&html5_firefox_ambisonic_opus=true&html5_av1_thresh=0&html5_adaptation_fix=true&web_player_attestation_auth_headers=true&hide_preskip=true&mweb_add_ad_info_button_on_fullscreen_only_devices=true&html5_max_headm_for_streaming_xhr=0&html5_disable_vp8_only_browsers=true&html5_unrewrite_timestamps=true&html5_quality_cap_min_age_secs=0&web_player_sentinel_is_uniplayer=true&kevlar_allow_multistep_video_init=true&bulleit_use_video_ad_div_as_overlay_container=true&lightweight_watch_video_swf=true&html5_hls_min_video_height=0&live_chunk_readahead=3&bulleit_terminate_ad_when_ending_with_commands=true&html5_manifestless_shrink_timestamps=true&html5_incremental_parser_buffer_extra_bytes=16384&html5_ignore_bad_bitrates=true&html5_min_readbehind_secs=0&html5_restrict_streaming_xhr_on_sqless_requests=true&enable_live_premiere_web_player_indicator=true&html5_jumbo_mobile_subsegment_readahead_target=3.0&html5_readahead_ratelimit=3000&html5_decode_to_texture_cap=true&desktop_player_button_tooltip_with_shortcut=true&html5_hfr_quality_cap=0&low_engagement_player_quality_cap=360&html5_playback_data_migration=true&html5_ad_stats_bearer=true&bulleit_use_cue_video_to_reset_on_stop_ad=true&html5_pipeline_ultra_low_latency=true&bulleit_remove_client_side_midroll_reactivation=true",
"ucid": "UCarfuQxcly5bNXIezBgbrcQ",
"csn": "u21lXIblOMu7gwO85p_4Dg",
"no_get_video_log": "1",
"cver": "1.20190213",
"tmi": "1",
"player_response": "{\"playabilityStatus\":{\"status\":\"UNPLAYABLE\",\"reason\":\"This video is unavailable.\",\"errorScreen\":{\"playerErrorMessageRenderer\":{\"reason\":{\"simpleText\":\"This video is unavailable.\"},\"proceedButton\":{\"buttonRenderer\":{\"style\":\"STYLE_PRIMARY\",\"size\":\"SIZE_DEFAULT\",\"isDisabled\":false,\"text\":{\"simpleText\":\"Watch on YouTube\"},\"trackingParams\":\"CAUQ8FsiEwjGrqPtqrvgAhXL3WAKHTzzB-8op5UD\"}},\"thumbnail\":{\"thumbnails\":[{\"url\":\"//s.ytimg.com/yts/img/meh7-vflGevej7.png\",\"width\":140,\"height\":100}]},\"icon\":{\"iconType\":\"ERROR_OUTLINE\"}}}},\"videoDetails\":{\"videoId\":\"3O1_3zBUKM8\",\"title\":\"Naughty Boy - La la la ft. Sam Smith\",\"lengthSeconds\":\"244\",\"keywords\":[\"Naughty\",\"Boy\",\"La\",\"Virgin\",\"Pop\",\"Naughty Boy\",\"NB\",\"Hotel Cabana\",\"HC\",\"Sam Smith\",\"LaLaLa\",\"La La La\",\"The Brits\",\"Brits 2014\",\"Best Single\"],\"channelId\":\"UCarfuQxcly5bNXIezBgbrcQ\",\"isOwnerViewing\":false,\"shortDescription\":\"From Naughty Boy's debut album \\\"Hotel Cabana\\\"\\nAVAILABLE NOW - Download: http://po.st/HCiTunes \\n\\nWatch the Hotel Cabana trailer at http://www.hotel-cabana.com \\n\\nFollow Naughty Boy\\nhttp://www.facebook.com/NBoyMusic \\nhttp://www.twitter.com/naughtyboymusic\\n\\nVideo Directed by Ian Pons Jewell\\n\\nMusic video by Naughty Boy Performing La La La. © 2013\\nNaughty Boy Recordings Ltd, under exclusive licence to Virgin Records Ltd.\",\"isCrawlable\":true,\"thumbnail\":{\"thumbnails\":[{\"url\":\"http://i.ytimg.com/vi/3O1_3zBUKM8/hqdefault.jpg?sqp=-oaymwEiCKgBEF5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ==\\u0026rs=AOn4CLDPD4kWz9Ka5D6E7vl5ZLrQi5jfKQ\",\"width\":168,\"height\":94},{\"url\":\"http://i.ytimg.com/vi/3O1_3zBUKM8/hqdefault.jpg?sqp=-oaymwEiCMQBEG5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ==\\u0026rs=AOn4CLDANMwzETmpjKzsddzPGEtPpOAW_g\",\"width\":196,\"height\":110},{\"url\":\"http://i.ytimg.com/vi/3O1_3zBUKM8/hqdefault.jpg?sqp=-oaymwEjCPYBEIoBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=\\u0026rs=AOn4CLD7_I4y877ghNH4H-J5F8npWrtL3g\",\"width\":246,\"height\":138},{\"url\":\"http://i.ytimg.com/vi/3O1_3zBUKM8/hqdefault.jpg?sqp=-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=\\u0026rs=AOn4CLDmleiZwXsglwaqiwxakgHNs5bVEA\",\"width\":336,\"height\":188}]},\"averageRating\":4.7239766,\"allowRatings\":true,\"viewCount\":\"944097200\",\"author\":\"NaughtyBoyVEVO\",\"isPrivate\":false,\"isUnpluggedCorpus\":false,\"isLiveContent\":false},\"messages\":[{\"mealbarPromoRenderer\":{\"messageTexts\":[{\"runs\":[{\"text\":\"Household sharing included. No complicated set-up. Unlimited DVR storage space. Cancel anytime.\"}]}],\"actionButton\":{\"buttonRenderer\":{\"style\":\"STYLE_PRIMARY\",\"size\":\"SIZE_DEFAULT\",\"text\":{\"runs\":[{\"text\":\"Try it free\"}]},\"navigationEndpoint\":{\"clickTrackingParams\":\"CAQQ7G8iEwjGrqPtqrvgAhXL3WAKHTzzB-8op5UD\",\"urlEndpoint\":{\"url\":\"https://tv.youtube.com/?utm_source=dmea\\u0026utm_medium=np\\u0026utm_campaign=dmea_evglo19h\\u0026pid=dmea-acq-u-2evgloh\"}},\"trackingParams\":\"CAQQ7G8iEwjGrqPtqrvgAhXL3WAKHTzzB-8op5UD\"}},\"dismissButton\":{\"buttonRenderer\":{\"style\":\"STYLE_BLUE_TEXT\",\"size\":\"SIZE_DEFAULT\",\"text\":{\"runs\":[{\"text\":\"No thanks\"}]},\"serviceEndpoint\":{\"clickTrackingParams\":\"CAMQ7W8iEwjGrqPtqrvgAhXL3WAKHTzzB-8op5UD\",\"feedbackEndpoint\":{\"feedbackToken\":\"AB9zfpJ28dV1uTmBv3-KAOkp1B4LWrc0l7aDyhooLNgKoKOIb4YIljQzt_xpRIY4s3FdAHP7Y9Fs82kdPNynErGmtWpoN08N_tB89C_iXbmVfGX2cBsVI9jYefRjrXMvrCsLYF9EB6GdbFkJG0QRV_d6yweeO8afwg\",\"uiActions\":{\"hideEnclosingContainer\":true}}},\"trackingParams\":\"CAMQ7W8iEwjGrqPtqrvgAhXL3WAKHTzzB-8op5UD\"}},\"triggerCondition\":\"TRIGGER_CONDITION_POST_AD\",\"style\":\"STYLE_MESSAGE\",\"trackingParams\":\"CAIQ42kYACITCMauo-2qu-ACFcvdYAodPPMH7yinlQM=\",\"impressionEndpoints\":[{\"clickTrackingParams\":\"CAIQ42kYACITCMauo-2qu-ACFcvdYAodPPMH7yinlQM=\",\"feedbackEndpoint\":{\"feedbackToken\":\"AB9zfpI_vFbKZTz2susb8fZ1ZN5ssfCrX8Yvphgc1zC6CZbPuuJBBSORpY_gOQMva2RzszXoLTPHxWk1QpPiklJ_Us4Dwogy2x2O8whkiigVfJ262DjwN-Cnv5S5qqZK47TOsy-lbTMkZAmNkQpbFnLbELAvObwWOw\",\"uiActions\":{\"hideEnclosingContainer\":false}}}],\"isVisible\":true,\"messageTitle\":{\"runs\":[{\"text\":\"YouTube TV - No long term contract\"}]}}}],\"adSafetyReason\":{\"isEmbed\":true,\"isRemarketingEnabled\":true,\"isFocEnabled\":true}}",
"innertube_api_key": "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",
"idpj": "-2",
"c": "WEB",
"enablecsi": "1",
"account_playback_token": "QUFFLUhqbFloSXVCbmZUOHI2ZkJPZ1VxV252MEt6RXlGd3xBQ3Jtc0ttWEtPeDdiVVB1akZxdVRvbS1PanZQMVZzcXdXaGNPa1F6d2dINWtoWXFpaEVkTnhycm1pMWZwaEZ0MHd1ckNnZXFWLXVTWjVTb3ZyM210bkhjU0tObEpNZjM4d3U0NjVnaDBfQ0JfM3g4VGs5LWRadw==",
"player_error_log_fraction": "1.0",
"fexp": "23710476,23733013,23735285,23735347,23736684,23737832,23744176,23750564,23751767,23752869,23755886,23755898,23758087,23758204,23759539,23760558,23761607,23762063,23762649,23770908,23775608,23776321,23779065,23780478,23783369,23783454,23785342,23787227,23788290,23788839,23789247,23789643,23791498,23791618,23791648,23792619,23794641,23794899,23795144,9449243,9452649,9471239,9474461,9475671,9479112",
"errorcode": "150",
"innertube_api_version": "v1",
"gapi_hint_params": "m;/_/scs/abc-static/_/js/k=gapi.gapi.en.Qyhlf-E27OQ.O/rt=j/d=1/rs=AHpOoo_77KcTN4WVhdQMqIfKBMTqlRW8yg/m=__features__",
"fmt_list": "",
"thumbnail_url": "http://i.ytimg.com/vi/3O1_3zBUKM8/default.jpg",
"reason": "This video is unavailable.",
"hl": "en_US",
"xhr_apiary_host": "youtubei.youtube.com",
"errordetail": "0",
"innertube_context_client_version": "1.20190213",
"status": "fail",
"error": true,
"instagram": "egy.js",
"apiMadeBy": "El-zahaby"
}
]
Check closely the reason and status properties - the player_response property might be useful too.
"reason": "This video is unavailable.",
"status": "fail",

Related

datadog monitering - create a metric that always returns a fixed value

In our application we are using datadog for monitoring, we are tracking the memory usage and sending the alert notinification to a slack channel. the monitoring config file is as below, i have added the formula for the numerator_metric. but for the demominator_metric, the value should be 1700, but i cant add the value directly over there instead i need to create a metric that always returns 1700,
{
"type": "metric_ratio",
"comparison": ">",
"numerator_metric": "aws.lambda.enhanced.max_memory_used{functionname:sample-function}",
"denominator_metric": "",
"warning_threshold": 70,
"target_threshold": 75,
"description": "Increased memory usage [prod]",
"monitor_timeframe": "1h",
"slo_timeframe": "7d",
"name": "Memory Usage",
"notify":[
{ "platform": "slack", "reference": "slack-channel" }
]
}

Need to print certain letters after a particular word using shell script

I am new to shell scripting and I want to print the IPs inside current cidr range and proposed cidr range below is the output
{
"acknowledgeRequiredBy": xxxxxx000,
"acknowledged": false,
"acknowledgedBy": "name#email.com",
"acknowledgedOn": xxxxxx00000,
"contacts": [
"dl#email.com",
"dl2#gmail.com"
],
"currentCidrs": [
"1.2.3.4/24",
"5.6.7.8/24",
"9.10.11.12/24",
"13.14.15.16/24",
"17.18.19.20/24",
"21.22.23.24/24",
"25.26.27.28/24",
],
"id": 1x4x3xx,
"latestTicketId": 0000,
"mapAlias": "sample name",
"mcmMapRuleId": 111xxx,
"proposedCidrs": [
"25.26.27.28/24",
"1.2.3.4/24",
"5.6.7.8/24",
"9.10.11.12/24",
],
"ruleName": "namerule.com",
"service": "S",
"shared": na,
"sureRouteName": "example",
I want the output as only the IPs please help me with the logic

Is there a way to use OCR to extract specific data from a CAD technical drawing?

I'm trying to use OCR to extract only the base dimensions of a CAD model, but there are other associative dimensions that I don't need (like angles, length from baseline to hole, etc). Here is an example of a technical drawing. (The numbers in red circles are the base dimensions, the rest in purple highlights are the ones to ignore.) How can I tell my program to extract only the base dimensions (the height, length, and width of a block before it goes through the CNC)?
The issue is that the drawings I get are not in a specific format, so I can't tell the OCR where the dimensions are. It has to figure out on its own contextually.
Should I train the program through machine learning by running several iterations and correcting it? If so, what methods are there? The only thing I can think of are Opencv cascade classifiers.
Or are there other methods to solving this problem?
Sorry for the long post. Thanks.
I feel you... it's a very tricky problem, and we spent the last 3 years finding a solution for it. Forgive me for mentioning the own solution, but it will certainly solve your problem: pip install werk24
from werk24 import Hook, W24AskVariantMeasures
from werk24.models.techread import W24TechreadMessage
from werk24.utils import w24_read_sync
from . import get_drawing_bytes # define your own
def recv_measures(message: W24TechreadMessage) -> None:
for cur_measure in message.payload_dict.get('measures'):
print(cur_measure)
if __name__ == "__main__":
# define what information you want to receive from the API
# and what shall be done when the info is available.
hooks = [Hook(ask=W24AskVariantMeasures(), function=recv_measures)]
# submit the request to the Werk24 API
w24_read_sync(get_drawing_bytes(), hooks)
In your example it will return for example the following measure
{
"position": <STRIPPED>
"label": {
"blurb": "ø30 H7 +0.0210/0",
"quantity": 1,
"size": {
"blurb": "30",
"size_type":" "DIAMETER",
"nominal_size": "30.0",
},
"unit": "MILLIMETER",
"size_tolerance": {
"toleration_type": "FIT_SIZE_ISO",
"blurb": "H7",
"deviation_lower": "0.0",
"deviation_upper": "0.0210",
"fundamental_deviation": "H",
"tolerance_grade": {
"grade":7,
"warnings":[]
},
"thread": null,
"chamfer": null,
"depth":null,
"test_dimension": null,
},
"warnings": [],
"confidence": 0.98810
}
or for a GD&T
{
"position": <STRIPPED>,
"frame": {
"blurb": "[⟂|0.05|A]",
"characteristic": "⟂",
"zone_shape": null,
"zone_value": {
"blurb": "0.05",
"width_min": 0.05,
"width_max": null,
"extend_quantity": null,
"extend_shape": null,
"extend": null,
"extend_angle": null
},
"zone_combinations": [],
"zone_offset": null,
"zone_constraint": null,
"feature_filter": null,
"feature_associated": null,
"feature_derived": null,
"reference_association": null,
"reference_parameter": null,
"material_condition": null,
"state": null,
"data": [
{
"blurb": "A"
}
]
}
}
Check the documentation on Werk24 for details.
Although a managed offering, Mixpeek is one free option:
pip install mixpeek
from mixpeek import Mixpeek
mix = Mixpeek(
api_key="my-api-key"
)
mix.upload(file_name="design_spec.dwg", file_path="s3://design_spec_1.dwg")
This /upload endpoint will extract the contents of your DWG file, then when you search for terms it will include the file_path so you can render it in your HTML.
Behind the scenes it uses the open source LibreDWG library to run a number of AutoCAD native commands such as DATAEXTRACTION.
Now you can search for a term and the relevant DWG file (in addition to the context in which it exists) will be returned:
mix.search(query="retainer", include_context=True)
[
{
"file_id": "6377c98b3c4f239f17663d79",
"filename": "design_spec.dwg",
"context": [
{
"texts": [
{
"type": "text",
"value": "DV-34-"
},
{
"type": "hit",
"value": "RETAINER"
},
{
"type": "text",
"value": "."
}
]
}
],
"importance": "100%",
"static_file_url": "s3://design_spec_1.dwg"
}
]
More documentation here: https://docs.mixpeek.com/

How to draw waveform from waveformdata object in iOS Swift?

[
{
"id": "48250",
"created_at": "2014-07-06 13:05:10",
"user_id": "7",
"duration": "7376",
"permalink": "shawne-back-to-the-roots-2-05072014",
"description": "Years: 2000 - 2005\r\nSet Time: Warm Up (11 pm - 01 am)\r\n",
"downloadable": "1",
"genre": "Drum & Bass",
"genre_slush": "drumandbass",
"title": "Shawne # Back To The Roots 2 (05.07.2014)",
"uri": "https:\/\/api-v2.hearthis.at\/\/shawne-back-to-the-roots-2-05072014\/",
"permalink_url": "http:\/\/hearthis.at\/\/shawne-back-to-the-roots-2-05072014\/",
"artwork_url": "http:\/\/hearthis.at\/_\/cache\/images\/track\/500\/801982cafc20a06ccf6203f21f10c08d_w500.png",
"background_url": "",
"waveform_data": "http:\/\/hearthis.at\/_\/wave_data\/7\/3000_4382f398c454c47cf171aab674cf00f0.mp3.js",
"waveform_url": "http:\/\/hearthis.at\/_\/wave_image\/7\/4382f398c454c47cf171aab674cf00f0.mp3.png",
"user": {
"id": "7",
"permalink": "shawne",
"username": "Shawne (hearthis.at)",
"uri": "https:\/\/api-v2.hearthis.at\/shawne\/",
"permalink_url": "http:\/\/hearthis.at\/shawne\/",
"avatar_url": "http:\/\/hearthis.at\/_\/cache\/images\/user\/512\/06a8299b0e7d8f2909a22697badd7c09_w512.jpg"
},
"stream_url": "http:\/\/hearthis.at\/shawne\/shawne-back-to-the-roots-2-05072014\/listen\/",
"download_url": "http:\/\/hearthis.at\/shawne\/shawne-back-to-the-roots-2-05072014\/download\/",
"playback_count": "75",
"download_count": "9",
"favoritings_count": "7",
"favorited": false,
"comment_count": "0"
}
]
This Api returns waveform url and waveformdata. How do I convert waveform data to draw waveform similar to image in waveformurl
Api - https://hearthis.at/api-v2/
It looks like the "data" is merely a succession of bar heights:
[136,132,133,133,138,...]
So just draw a succession of bars at those heights (or heights proportional to them). You might need to draw just every nth bar, or maybe average each clump of n bars together, in order to get a neater representation (that is what they do at the site you pointed to).

How to get the value from a List using Rest Assured?

I am trying to grab the first value of courseNumber for studenId=123 using Rest Assured.
When I using
.body("students.courseList.courseNumber[0]",equalTo(1000000000))
I am getting:
Expected: <1000000000>
Actual: [1000000000, 1000000001, 1000000002, 1000000003, ...........]
There are more than 10 courseList for studentId 123.
Also is it possible to use regex to grab a particular element from JSON Response or how do I get the path of an element when I have a few thousand lines of JSON Response.
Sample Response -
{
"students": [
{
"studentId": "ABC",
"studentName": "Abcd Abcd",
"courseDescription": "AAJSHKJASSJAK LASNLKASA KJk;;K K;;KK;K;KL;K;",
"creditRemaining": 100,
"classStartDate": "20191220"
},
{
"studentId": "123",
"studentName": "DEFG, VBNH",
"courseDescription": "AAJSHKJASSJAK LASNLKASA KJk;;K K;;KK;K;KL;K;",
"classSchedule": 2,
"classStartDate": "20191220",
"slotsRemaining": 10,
"courseList": [
{
"courseNumber": 1000000000,
"courseName": "Chemistry",
"courseInstructor": "HGJ IOUIOU"
"courseCity": "New York",
"courseLevel": 100,
"description": "GJKJLKJLafgdhgf ljkllklk klyiyy mnbbnkljlkj
yttiuyuyuyoyo
jhlkjkljkl"},
{
"courseNumber": 1000000001,
"courseName": "History",
"courseInstructor": "HGJ IOUIOU"
"courseCity": "New York",
"courseLevel": 100,
"description": "GJKJLKJLafgdhgf ljkllklk klyiyy mnbbnkljlkj yttiuyuyuyoyo
jhlkjkljkl"},
]
}
students.courseList.courseNumber[0][0] --> will give 1000000000
students.courseList.courseNumber[0][1] --> will give 1000000001

Resources